From 2f7642aa035a82576ee4bb69c284005d731c081e Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 14 Jun 2023 16:29:26 +0100 Subject: [PATCH] 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. --- test/helpers/application_helper_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.39.5