From: Andy Allan Date: Wed, 14 Jun 2023 15:29:26 +0000 (+0100) Subject: Fix test to work in non-UK timezones X-Git-Tag: live~1395^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2f7642aa035a82576ee4bb69c284005d731c081e Fix test to work in non-UK timezones Time.new(...).utc is not the same as Time.utc(...). The first creates a given date in local time, and then converts that to utc, whereas the second creates the given time in UTC. --- diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 06c1c09f8..7cd6bce89 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -56,7 +56,7 @@ class ApplicationHelperTest < ActionView::TestCase end def test_friendly_date - date = friendly_date(Time.new(2014, 3, 5, 18, 58, 23).utc) + date = friendly_date(Time.utc(2014, 3, 5, 18, 58, 23)) assert_match %r{^.*$}, date date = friendly_date(Time.now.utc - 1.hour)