finish updating cucumber scenario's to the stricter capybara

This commit is contained in:
Reinier Balt 2013-01-01 17:38:59 +01:00
parent ee3f8a3f8b
commit 796685072d
11 changed files with 55 additions and 34 deletions

View file

@ -10,10 +10,16 @@ class DoneTodos
end
def self.done_this_week(todos, includes = {:include => Todo::DEFAULT_INCLUDES})
todos.completed_before(Time.zone.now.beginning_of_day).completed_after(Time.zone.now.beginning_of_week).all(includes)
done_between(todos, Time.zone.now.beginning_of_day, Time.zone.now.beginning_of_week)
end
def self.done_this_month(todos, includes = {:include => Todo::DEFAULT_INCLUDES})
todos.completed_before(Time.zone.now.beginning_of_week).completed_after(Time.zone.now.beginning_of_month).all(includes)
done_between(todos, includes, Time.zone.now.beginning_of_week, Time.zone.now.beginning_of_month)
end
private
def self.done_between(todos, includes, start_date, end_date)
todos.completed_before(start_date).completed_after(end_date).all(includes)
end
end