From f031d1289f3d18c25122169bec32401b63576b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 18 Jun 2019 21:34:52 +0200 Subject: [PATCH] Fix confusing time zone terminology So now, application zone is the one defined in `config.time_zone`, and system zone is the one in the computer where the application is running. --- spec/spec_helper.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a1c4b58a8..2b5458e96 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -96,13 +96,11 @@ RSpec.configure do |config| end config.before(:each, :with_different_time_zone) do - system_zone = ActiveSupport::TimeZone.new("UTC") - local_zone = ActiveSupport::TimeZone.new("Madrid") + application_zone = ActiveSupport::TimeZone.new("UTC") + system_zone = ActiveSupport::TimeZone.new("Madrid") - # Make sure the date defined by `config.time_zone` and - # the local date are different. - allow(Time).to receive(:zone).and_return(system_zone) - allow(Time).to receive(:now).and_return(Date.current.at_end_of_day.in_time_zone(local_zone)) + allow(Time).to receive(:zone).and_return(application_zone) + allow(Time).to receive(:now).and_return(Date.current.end_of_day.in_time_zone(system_zone)) allow(Date).to receive(:today).and_return(Time.now.to_date) end