Reset `I18n.locale` in tests.

This commit is contained in:
Guo Xiang Tan 2016-09-29 13:42:56 +08:00
parent 72ccb4e11d
commit 40b83ebb47
2 changed files with 7 additions and 2 deletions

View File

@ -18,6 +18,7 @@ describe JsLocaleHelper do
JsLocaleHelper.extend StubLoadTranslations JsLocaleHelper.extend StubLoadTranslations
after do after do
I18n.locale = :en
JsLocaleHelper.clear_cache! JsLocaleHelper.clear_cache!
end end

View File

@ -18,9 +18,13 @@ describe Badge do
badge = Badge.find_by_name("Basic User") badge = Badge.find_by_name("Basic User")
name_english = badge.name name_english = badge.name
I18n.locale = 'fr' begin
I18n.locale = 'fr'
expect(badge.display_name).not_to eq(name_english) expect(badge.display_name).not_to eq(name_english)
ensure
I18n.locale = :en
end
end end
it 'handles changes on badge description and long description correctly for system badges' do it 'handles changes on badge description and long description correctly for system badges' do