mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 05:05:18 +01:00
finish updating cucumber scenario's to the stricter capybara
This commit is contained in:
parent
ee3f8a3f8b
commit
796685072d
11 changed files with 55 additions and 34 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue