From 024a0dc7045c0dc61266ef689f2f6504e2785080 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 1 Jun 2017 00:09:28 +0900 Subject: [PATCH] Hold value of I18n.locale with ApplicationHelperSpec (#3474) --- spec/helpers/application_helper_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 7b875e21f4..ac54f1f703 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -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'