aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/localisation_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-07-24 10:39:41 +0100
committerLouise Crow <louise.crow@gmail.com>2013-07-24 10:39:41 +0100
commitd00834ef5b8e834cedf5c0ef22c19ae52c5ced0a (patch)
treec27c6683bb957286af74ff922040afa3d2945db0 /spec/integration/localisation_spec.rb
parent44f3c921e6b839224e5be1c2ea65e01a05d14202 (diff)
Move some more config into AlaveteliLocalization so that it can be called outside initialization e.g. in tests.
Diffstat (limited to 'spec/integration/localisation_spec.rb')
-rw-r--r--spec/integration/localisation_spec.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/integration/localisation_spec.rb b/spec/integration/localisation_spec.rb
index 64d39f0af..4f6b61ae1 100644
--- a/spec/integration/localisation_spec.rb
+++ b/spec/integration/localisation_spec.rb
@@ -53,15 +53,10 @@ describe "when generating urls" do
@old_include_default_locale_in_urls = AlaveteliConfiguration::include_default_locale_in_urls
end
- def set_default_locale_in_urls(value)
- AlaveteliConfiguration.stub!(:include_default_locale_in_urls).and_return(value)
- load Rails.root.join("config/initializers/fast_gettext.rb")
- end
-
describe 'when the config value INCLUDE_DEFAULT_LOCALE_IN_URLS is false' do
before do
- set_default_locale_in_urls(false)
+ AlaveteliLocalization.set_default_locale_urls(false)
end
it 'should generate URLs without a locale prepended' do
@@ -78,13 +73,13 @@ describe "when generating urls" do
it 'should generate URLs with a locale prepended when the config value
INCLUDE_DEFAULT_LOCALE_IN_URLS is true' do
- set_default_locale_in_urls(true)
+ AlaveteliLocalization.set_default_locale_urls(true)
get '/'
response.body.should match /#{@default_lang_home_link}/
end
after do
- set_default_locale_in_urls(@old_include_default_locale_in_urls)
+ AlaveteliLocalization.set_default_locale_urls(@old_include_default_locale_in_urls)
end
end