diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 0958f7a..34b9b73 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -78,12 +78,8 @@ class ApplicationController < ActionController::Base end end def default_locale - if Noosfero.default_locale - if cookies[:lang].blank? - set_locale Noosfero.default_locale - else - set_locale cookies[:lang] - end + if Noosfero.default_locale && cookies[:lang].blank? + cookies[:lang] = params[:lang] = Noosfero.default_locale end end protected :maybe_save_locale, :default_locale diff --git a/config/environment.rb b/config/environment.rb index 217ab1e..2a21d2f 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -128,7 +128,7 @@ require 'noosfero' require 'sqlite_extension' # load a local configuration if present, but not under test environment. -if ENV['RAILS_ENV'] != 'test' +if !['test', 'cucumber'].include?(ENV['RAILS_ENV']) localconfigfile = File.join(RAILS_ROOT, 'config', 'local.rb') if File.exists?(localconfigfile) require localconfigfile -- libgit2 0.21.2