From 62bc47b26bbdd912956c5aecb10abe94f2478995 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Tue, 17 Sep 2013 15:40:20 +0200 Subject: [PATCH] fix regression in recurring todos --- app/models/recurring_todo.rb | 2 +- test/models/recurring_todo_test.rb | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/recurring_todo.rb b/app/models/recurring_todo.rb index 529384a4..536779ca 100644 --- a/app/models/recurring_todo.rb +++ b/app/models/recurring_todo.rb @@ -489,7 +489,7 @@ class RecurringTodo < ActiveRecord::Base case self.recurrence_selector when 0 # specific day of the month - if start.mday >= day + if (previous && start.mday >= day) || (previous.nil? && start.mday > day) # there is no next day n in this month, search in next month # # start += n.months diff --git a/test/models/recurring_todo_test.rb b/test/models/recurring_todo_test.rb index c3124aab..a1bd2d1e 100644 --- a/test/models/recurring_todo_test.rb +++ b/test/models/recurring_todo_test.rb @@ -175,9 +175,6 @@ class RecurringTodoTest < ActiveSupport::TestCase assert_equal @sunday, due_date # june 8th due_date = @monthly.get_due_date(@sunday) # june 8th - assert_equal Time.zone.local(2008,6,8), due_date # june 8th - - due_date = @monthly.get_due_date(@monday) # june 9th assert_equal Time.zone.local(2008,8,8), due_date # aug 8th end @@ -247,7 +244,7 @@ class RecurringTodoTest < ActiveSupport::TestCase # every_day should return start_day if it is in the future @every_day.start_from = @in_three_days due_date = @every_day.get_due_date(nil) - assert_equal @in_three_days, due_date + assert_equal @in_three_days.to_s(:db), due_date.to_s(:db) due_date = @every_day.get_due_date(@tomorrow) assert_equal @in_three_days, due_date