Commit 8b709bd0b4a2a8a3499b0e451ba262416a557196

Authored by Lucas Kanashiro
1 parent cd3edc92

community_track: use assert_in_delta with DateTime

Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
plugins/community_track/test/unit/community_track_plugin/step_test.rb
@@ -124,14 +124,14 @@ class StepTest &lt; ActiveSupport::TestCase @@ -124,14 +124,14 @@ class StepTest &lt; ActiveSupport::TestCase
124 @step.end_date = DateTime.now.end_of_day 124 @step.end_date = DateTime.now.end_of_day
125 @step.accept_comments = false 125 @step.accept_comments = false
126 @step.schedule_activation 126 @step.schedule_activation
127 - assert_equal @step.start_date, Delayed::Job.first.run_at 127 + assert_in_delta @step.start_date, Delayed::Job.first.run_at
128 end 128 end
129 129
130 should 'create delayed job if end date has passed' do 130 should 'create delayed job if end date has passed' do
131 @step.start_date = DateTime.now - 5.days 131 @step.start_date = DateTime.now - 5.days
132 @step.end_date = DateTime.now - 2.days 132 @step.end_date = DateTime.now - 2.days
133 @step.schedule_activation 133 @step.schedule_activation
134 - assert_equal @step.end_date + 1.day, Delayed::Job.first.run_at 134 + assert_in_delta @step.end_date + 1.day, Delayed::Job.first.run_at
135 end 135 end
136 136
137 should 'do not schedule delayed job if save but do not modify date fields' do 137 should 'do not schedule delayed job if save but do not modify date fields' do