diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-20 15:58:11 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-08-20 15:58:11 +0100 |
commit | ce30500cea5c2d6304643bc90ce0c5b36a2f5919 (patch) | |
tree | 92ef48879721d017e7b72e663ef8dbc3d6421fb0 /spec/spec_helper.rb | |
parent | f757ce4ba02c6621e04a349376aeda1c1cb553a3 (diff) | |
parent | dfb5f97ac44656f0e021b09856e0c54b9fa41b3f (diff) |
Merge branch 'release/0.13'0.13
Conflicts:
locale/bg/app.po
locale/es/app.po
locale/fi/app.po
locale/fr/app.po
locale/fr_CA/app.po
locale/he_IL/app.po
locale/hr/app.po
locale/nb_NO/app.po
locale/nl/app.po
locale/pt_BR/app.po
locale/ro_RO/app.po
locale/sl/app.po
locale/vi/app.po
script/rails-post-deploy
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a3b06cea8..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 @@ -88,12 +87,19 @@ Spork.prefork do # ApplicationController#set_gettext_locale which sets the locale and so you may be setting # the locale in your tests and not even realising it. So, let's make things easier for # ourselves and just always restore the locale for all tests. + config.after(:each) do + AlaveteliLocalization.set_locales(AlaveteliConfiguration::available_locales, + AlaveteliConfiguration::default_locale) + end + + # Turn routing-filter off in functional and unit tests as per + # https://github.com/svenfuchs/routing-filter/blob/master/README.markdown#testing config.before(:each) do - @save_i18n_locale = I18n.locale + RoutingFilter.active = false if [:controller, :helper, :model].include? example.metadata[:type] end config.after(:each) do - I18n.locale = @save_i18n_locale + RoutingFilter.active = true if [:controller, :helper, :model].include? example.metadata[:type] end # This section makes the garbage collector run less often to speed up tests |