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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user