Using the Time Data

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

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

Here you added one more completed task, and you’re using the ability to pass a completed ...

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

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