Hold value of I18n.locale with ApplicationHelperSpec (#3474)

rebase/4.0.0rc2
Yamagishi Kazutoshi 2017-06-01 00:09:28 +09:00 committed by Eugen Rochko
parent 41fa53253c
commit 1a4860a57a
1 changed files with 6 additions and 0 deletions

View 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'