aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/general_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-20 15:17:27 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-20 15:17:27 +0000
commit61eb3a3ac95efbeae60b977cc1a3b4f9d3cc752d (patch)
tree54ed62e83ffb537a79883348ce891d199219a4b9 /spec/controllers/general_controller_spec.rb
parentbcb7d7434e804a118787bce1365c4bc28f6a1784 (diff)
Remove assumption
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.
Diffstat (limited to 'spec/controllers/general_controller_spec.rb')
-rw-r--r--spec/controllers/general_controller_spec.rb11
1 files changed, 5 insertions, 6 deletions
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