diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/integration/localisation_spec.rb | 11 | ||||
-rw-r--r-- | spec/spec_helper.rb | 3 |
2 files changed, 4 insertions, 10 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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7e3df4f39..86ca5150a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -31,8 +31,7 @@ Spork.prefork do Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} # Use test-specific translations - FastGettext.add_text_domain 'app', :path => File.join(File.dirname(__FILE__), 'fixtures', 'locale'), :type => :po - FastGettext.default_text_domain = 'app' + AlaveteliLocalization.set_default_text_domain('app', File.join(File.dirname(__FILE__), 'fixtures', 'locale')) RSpec.configure do |config| # ## Mock Framework |