From b6af10a91fa70e3d901b2bf8c03279b2623a894f Mon Sep 17 00:00:00 2001 From: kikito Date: Tue, 20 Oct 2015 19:08:52 +0200 Subject: [PATCH] refactors localization spec using expect instead of global state --- spec/features/localization_spec.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/spec/features/localization_spec.rb b/spec/features/localization_spec.rb index ddea1e38b..810d07503 100644 --- a/spec/features/localization_spec.rb +++ b/spec/features/localization_spec.rb @@ -34,13 +34,10 @@ feature 'Localization' do end scenario 'Locale switcher not present if only one locale' do - initial_locales = I18n.available_locales - I18n.available_locales = [:en] + expect(I18n).to receive(:available_locales).and_return([:en]) visit '/' expect(page).to_not have_content('Language') expect(page).to_not have_css('div.locale') - - I18n.available_locales = initial_locales end end