fix failing tests with use of localtime

This commit is contained in:
Reinier Balt 2015-04-13 15:57:57 +02:00
parent 403cc1015e
commit 319d4b00cd
2 changed files with 19 additions and 19 deletions

View file

@ -378,7 +378,7 @@ class RecurringTodosControllerTest < ActionController::TestCase
}, },
"tag_list"=>"one, two, three, four", format: :js "tag_list"=>"one, two, three, four", format: :js
assert_equal "new recurring pattern", assigns['recurring_todo'].description assert_equal "new recurrence pattern", assigns['recurring_todo'].description
assert_equal "2013-01-02", assigns['recurring_todo'].start_from.localtime.to_date.to_s assert_equal "2013-01-02", assigns['recurring_todo'].start_from.localtime.to_date.to_s
todo = assigns['recurring_todo'].todos.first todo = assigns['recurring_todo'].todos.first
assert_equal "2013-01-02", todo.show_from.localtime.to_date.to_s assert_equal "2013-01-02", todo.show_from.localtime.to_date.to_s

View file

@ -22,8 +22,8 @@ class TodoTest < ActiveSupport::TestCase
assert_equal "Call Bill Gates to find out how much he makes per day", @not_completed1.description assert_equal "Call Bill Gates to find out how much he makes per day", @not_completed1.description
assert_nil @not_completed1.notes assert_nil @not_completed1.notes
assert @not_completed1.completed? == false assert @not_completed1.completed? == false
assert_equal 1.week.ago.beginning_of_day.strftime("%Y-%m-%d %H:%M"), @not_completed1.created_at.beginning_of_day.strftime("%Y-%m-%d %H:%M") assert_equal 1.week.ago.beginning_of_day.to_date.to_s, @not_completed1.created_at.localtime.beginning_of_day.to_date.to_s
assert_equal 2.week.from_now.beginning_of_day.strftime("%Y-%m-%d"), @not_completed1.due.strftime("%Y-%m-%d") assert_equal 2.week.from_now.beginning_of_day.to_date.to_s, @not_completed1.due.localtime.to_date.to_s
assert_nil @not_completed1.completed_at assert_nil @not_completed1.completed_at
assert_equal 1, @not_completed1.user_id assert_equal 1, @not_completed1.user_id
end end