]> cat aescling's git repositories - mastodon.git/commitdiff
Hold value of I18n.locale with ApplicationHelperSpec (#3474)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Wed, 31 May 2017 15:09:28 +0000 (00:09 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 31 May 2017 15:09:28 +0000 (17:09 +0200)
spec/helpers/application_helper_spec.rb

index 7b875e21f46d82f70ed7d194a7c12423de8e4093..ac54f1f703036a296a198f598374fa0a22f765b7 100644 (file)
@@ -18,6 +18,12 @@ describe ApplicationHelper do
   end
 
   describe 'add_rtl_body_class' do
+    around do |example|
+      current_locale = I18n.locale
+      example.run
+      I18n.locale = current_locale
+    end
+
     it 'adds rtl body class if locale is Arabic' do
       I18n.locale = :ar
       expect(helper.add_rtl_body_class('other classes')).to eq 'other classes rtl'