mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-28 21:08:48 +01:00
move daily test to daily pattern test
This commit is contained in:
parent
b84adfc172
commit
a9fa955c33
4 changed files with 53 additions and 32 deletions
|
|
@ -25,29 +25,6 @@ class RecurringTodoTest < ActiveSupport::TestCase
|
|||
@thursday = Time.zone.local(2008,6,12)
|
||||
end
|
||||
|
||||
def test_daily_every_day
|
||||
# every_day should return todays date if there was no previous date
|
||||
due_date = @every_day.get_due_date(nil)
|
||||
# use only day-month-year compare, because milisec / secs could be different
|
||||
assert_equal_dmy @today, due_date
|
||||
|
||||
# when the last todo was completed today, the next todo is due tomorrow
|
||||
due_date =@every_day.get_due_date(@today)
|
||||
assert_equal @tomorrow, due_date
|
||||
|
||||
# do something every 14 days
|
||||
@every_day.every_other1=14
|
||||
due_date = @every_day.get_due_date(@today)
|
||||
assert_equal @today+14.days, due_date
|
||||
end
|
||||
|
||||
def test_daily_work_days
|
||||
assert_equal @monday, @every_workday.get_due_date(@friday)
|
||||
assert_equal @monday, @every_workday.get_due_date(@saturday)
|
||||
assert_equal @monday, @every_workday.get_due_date(@sunday)
|
||||
assert_equal @tuesday, @every_workday.get_due_date(@monday)
|
||||
end
|
||||
|
||||
def test_show_from_date
|
||||
# assume that target due_date works fine, i.e. don't do the same tests over
|
||||
|
||||
|
|
@ -81,14 +58,6 @@ class RecurringTodoTest < ActiveSupport::TestCase
|
|||
# weekly/monthly/yearly
|
||||
end
|
||||
|
||||
def test_end_date_on_recurring_todo
|
||||
assert_equal true, @every_day.continues_recurring?(@in_three_days)
|
||||
assert_equal true, @every_day.continues_recurring?(@in_four_days)
|
||||
@every_day.end_date = @in_four_days
|
||||
@every_day.ends_on = 'ends_on_end_date'
|
||||
assert_equal false, @every_day.continues_recurring?(@in_four_days)
|
||||
end
|
||||
|
||||
def test_weekly_pattern
|
||||
assert_equal true, @weekly_every_day.continues_recurring?(nil)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue