Add and appy RSpec/Rails/TravelAround rubocop rule
This rule was added in rubocop-rspec 2.19.0. When freezing time in a test, `travel_back` is called automatically when the test finishes, so we can do it in a `before` block instead of an `around` block. Note this rule didn't detect our usage of `freeze_time` because we were using it on cops with a certain tag, but I expect the rule to be able to detect this usage in the future.
This commit is contained in:
@@ -561,6 +561,9 @@ RSpec/Rails/HaveHttpStatus:
|
||||
RSpec/Rails/InferredSpecType:
|
||||
Enabled: true
|
||||
|
||||
RSpec/Rails/TravelAround:
|
||||
Enabled: true
|
||||
|
||||
RSpec/RepeatedExample:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -148,9 +148,7 @@ RSpec.configure do |config|
|
||||
.to receive(:locales).and_return(I18n.available_locales.map(&:to_s))
|
||||
end
|
||||
|
||||
config.around(:each, :with_frozen_time) do |example|
|
||||
freeze_time { example.run }
|
||||
end
|
||||
config.before(:each, :with_frozen_time) { freeze_time }
|
||||
|
||||
config.before(:each, :application_zone_west_of_system_zone) do
|
||||
application_zone = ActiveSupport::TimeZone.new("Quito")
|
||||
|
||||
Reference in New Issue
Block a user