mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-27 04:18:49 +01:00
fixes #786 where timezone handling of RoR screwed the algorithm to find the last sunday of march in 2009
Fix is a bit of a hack, see #786 for futher explanation.
This commit is contained in:
parent
c5cff97f3f
commit
a3f23c60e4
4 changed files with 74 additions and 6 deletions
|
|
@ -197,6 +197,15 @@ class RecurringTodoTest < Test::Rails::TestCase
|
|||
assert_equal due_date1, due_date2
|
||||
end
|
||||
|
||||
def test_last_sunday_of_march
|
||||
@yearly.recurrence_selector = 1
|
||||
@yearly.every_other2 = 3 # march
|
||||
@yearly.every_other3 = 5 # last
|
||||
@yearly.every_count = 0 # sunday
|
||||
due_date = @yearly.get_due_date(Time.zone.local(2008,10,1)) # oct 1st
|
||||
assert_equal Time.zone.local(2009,3,29), due_date # march 29th
|
||||
end
|
||||
|
||||
def test_start_from_in_future
|
||||
# every_day should return start_day if it is in the future
|
||||
@every_day.start_from = @in_three_days
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue