From 7daa6f4a779727f1a57a4806692f43b58e150eb9 Mon Sep 17 00:00:00 2001 From: bogdanvlviv Date: Mon, 19 Mar 2018 01:03:39 +0200 Subject: Fix failing `QuotingTest#test_quoted_time_utc` This test fails in specific time. Example: If run this test on the machine with time 01:00 am UTC+2, this test will fail. Changing representing of 2000-01-01 01:00 am UTC+2 to UTC+0 change the day, month and even year in our case, so substitution `"2000-01-01 "` to `""` isn't possible. ``` Failure: ActiveRecord::ConnectionAdapters::QuotingTest#test_quoted_time_utc Expected: "1999-12-31 23:01:27" Actual: "23:01:27" ``` Related to 7c479cbf --- activerecord/test/cases/quoting_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/quoting_test.rb b/activerecord/test/cases/quoting_test.rb index a8eed2ff26..92eb0c814f 100644 --- a/activerecord/test/cases/quoting_test.rb +++ b/activerecord/test/cases/quoting_test.rb @@ -71,8 +71,8 @@ module ActiveRecord with_timezone_config default: :utc do t = Time.now.change(usec: 0) - expected = t.change(year: 2000, month: 1, day: 1) - expected = expected.getutc.to_s(:db).sub("2000-01-01 ", "") + expected = t.getutc.change(year: 2000, month: 1, day: 1) + expected = expected.to_s(:db).sub("2000-01-01 ", "") assert_equal expected, @quoter.quoted_time(t) end -- cgit v1.2.3