From: Tom Hughes Date: Sun, 30 Sep 2012 13:24:28 +0000 (+0100) Subject: Increase allowed time delta in message sending test X-Git-Tag: live~5305 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ab3b4b0437427dce80efd0774c34ac40591c1e3d?ds=sidebyside Increase allowed time delta in message sending test Only allowing one second can fail sometimes, because if the actual time is close to rolling over to the next second then the message time will be rounded down but Time.now may roll over to the next second before we get to the assertion. --- diff --git a/test/functional/message_controller_test.rb b/test/functional/message_controller_test.rb index 45190b714..d6b5671ac 100644 --- a/test/functional/message_controller_test.rb +++ b/test/functional/message_controller_test.rb @@ -85,7 +85,7 @@ class MessageControllerTest < ActionController::TestCase m = Message.find(3) assert_equal users(:normal_user).id, m.from_user_id assert_equal users(:public_user).id, m.to_user_id - assert_in_delta Time.now, m.sent_on, 1 + assert_in_delta Time.now, m.sent_on, 2 assert_equal "Test Message", m.title assert_equal "Test message body", m.body assert_equal "markdown", m.body_format