From 61eb3a3ac95efbeae60b977cc1a3b4f9d3cc752d Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Fri, 20 Jan 2012 15:17:27 +0000 Subject: Remove assumption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I feel uncomfortable about the assumption that FastGettext.default_available_locales is always equal to I18n.available_locales. Even if that’s true now, it might not always be -- and if a bug causes them to become erroneously different, the previous code would have masked that. --- spec/controllers/general_controller_spec.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'spec/controllers/general_controller_spec.rb') diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index a5bb3ba5a..bcd577484 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -96,16 +96,15 @@ describe GeneralController, "when searching" do end it "should generate URLs without a locale prepended when there's only one locale set" do - old_available_locales = FastGettext.default_available_locales - available_locales = ['en'] - FastGettext.default_available_locales = available_locales - I18n.available_locales = available_locales + old_fgt_available_locales = FastGettext.default_available_locales + old_i18n_available_locales = I18n.available_locales + FastGettext.default_available_locales = I18n.available_locales = ['en'] get :frontpage response.should_not have_text(home_link_regex) - FastGettext.default_available_locales = old_available_locales - I18n.available_locales = old_available_locales + FastGettext.default_available_locales = old_fgt_available_locales + I18n.available_locales = old_i18n_available_locales end end -- cgit v1.2.3