diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f998be775..12ea3133e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -51,7 +51,7 @@ class ApplicationController < ActionController::Base end end - before_filter :session_expiration, :user_setup, :check_if_login_required, :check_password_change, :set_localization + before_filter :session_expiration, :user_setup, :check_if_login_required, :set_localization, :check_password_change rescue_from ::Unauthorized, :with => :deny_access rescue_from ::ActionView::MissingTemplate, :with => :missing_template diff --git a/test/integration/account_test.rb b/test/integration/account_test.rb index 0f12a1c83..5adbe8631 100644 --- a/test/integration/account_test.rb +++ b/test/integration/account_test.rb @@ -146,6 +146,21 @@ class AccountTest < Redmine::IntegrationTest assert_redirected_to '/my/password' end + def test_flash_message_should_use_user_language_when_redirecting_user_for_password_change + user = User.find_by_login('jsmith') + user.must_change_passwd = true + user.language = 'it' + user.save! + + post '/login', :username => 'jsmith', :password => 'jsmith' + assert_redirected_to '/my/page' + follow_redirect! + assert_redirected_to '/my/password' + follow_redirect! + + assert_select 'div.error', :text => /richiesto che sia cambiata/ + end + def test_user_with_must_change_passwd_should_be_able_to_change_its_password User.find_by_login('jsmith').update_attribute :must_change_passwd, true