Do not exclude spec_helper.rb from Rails/I18nLocaleAssignment cop
Use the around action to set the desired locale so we do not break the rule.
This commit is contained in:
@@ -269,8 +269,6 @@ Rails/HttpStatus:
|
||||
|
||||
Rails/I18nLocaleAssignment:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- "spec/spec_helper.rb"
|
||||
|
||||
Rails/InverseOf:
|
||||
Enabled: true
|
||||
|
||||
@@ -30,11 +30,16 @@ RSpec.configure do |config|
|
||||
end
|
||||
|
||||
config.before do |example|
|
||||
I18n.locale = :en
|
||||
Globalize.set_fallbacks_to_all_available_locales
|
||||
Setting["feature.user.skip_verification"] = nil
|
||||
end
|
||||
|
||||
config.around do |example|
|
||||
I18n.with_locale(:en) do
|
||||
example.run
|
||||
end
|
||||
end
|
||||
|
||||
config.around(:each, :race_condition) do |example|
|
||||
self.use_transactional_tests = false
|
||||
example.run
|
||||
|
||||
Reference in New Issue
Block a user