about summary refs log tree commit diff
path: root/spec/controllers
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2018-04-22 18:41:39 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-04-22 11:41:39 +0200
commit648d645c2fc4e7b266cb4d83bd4ed62e929dd363 (patch)
treebd95ca72c38cf04c6c13bb9de7a65b9e1640a414 /spec/controllers
parent3fa316147228819c48fd4f20c5c30f4f34b85f07 (diff)
Fix randomly fail (similar #7219) (#7225)
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/concerns/localized_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/controllers/concerns/localized_spec.rb b/spec/controllers/concerns/localized_spec.rb
index f71c96aff..8c80b7d2a 100644
--- a/spec/controllers/concerns/localized_spec.rb
+++ b/spec/controllers/concerns/localized_spec.rb
@@ -11,13 +11,17 @@ describe ApplicationController, type: :controller do
     end
   end
 
+  around do |example|
+    current_locale = I18n.locale
+    example.run
+    I18n.locale = current_locale
+  end
+
   before do
     routes.draw { get 'success' => 'anonymous#success' }
   end
 
   shared_examples 'default locale' do
-    after { I18n.locale = I18n.default_locale }
-
     it 'sets available and preferred language' do
       request.headers['Accept-Language'] = 'ca-ES, fa'
       get 'success'