Using the Time Data

With the task tests passing, it’s time to switch our attention back to the Project test. We need to make a slight tweak to our project_with_data_test setup so that we have tasks that are in and out of the three-week velocity window:

let(:project) { }
let(:newly_done) { 3, completed_at: }
let(:old_done) { 2, completed_at: 6.months.ago) }
let(:small_not_done) { 1) }
let(:large_not_done) { 4) }
before(:example) ​do
project.tasks = [newly_done, old_done, small_not_done, large_not_done]

We’ve added one more completed task, and we’re using the ability to pass a completed date to ...

Get Rails 4 Test Prescriptions now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.