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:
|
Rails/I18nLocaleAssignment:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Exclude:
|
|
||||||
- "spec/spec_helper.rb"
|
|
||||||
|
|
||||||
Rails/InverseOf:
|
Rails/InverseOf:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|||||||
@@ -30,11 +30,16 @@ RSpec.configure do |config|
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.before do |example|
|
config.before do |example|
|
||||||
I18n.locale = :en
|
|
||||||
Globalize.set_fallbacks_to_all_available_locales
|
Globalize.set_fallbacks_to_all_available_locales
|
||||||
Setting["feature.user.skip_verification"] = nil
|
Setting["feature.user.skip_verification"] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
config.around do |example|
|
||||||
|
I18n.with_locale(:en) do
|
||||||
|
example.run
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
config.around(:each, :race_condition) do |example|
|
config.around(:each, :race_condition) do |example|
|
||||||
self.use_transactional_tests = false
|
self.use_transactional_tests = false
|
||||||
example.run
|
example.run
|
||||||
|
|||||||
Reference in New Issue
Block a user