Fixed: The error flash message on session expiration is not in the language of the user but of the user of the previous request (#17023).

git-svn-id: http://svn.redmine.org/redmine/trunk@13391 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-09-13 10:35:46 +00:00
parent e124da5488
commit 77b0abb79c
2 changed files with 19 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ class SessionStartTest < ActionController::TestCase
end
class SessionsTest < ActionController::TestCase
include Redmine::I18n
tests WelcomeController
fixtures :users
@@ -108,6 +109,20 @@ class SessionsTest < ActionController::TestCase
end
end
def test_expired_user_session_should_set_locale
set_language_if_valid 'it'
user = User.find(2)
user.language = 'fr'
user.save!
with_settings :session_timeout => '60' do
get :index, {}, {:user_id => user.id, :atime => 4.hours.ago.utc.to_i}
assert_redirected_to '/login'
assert_include "Veuillez vous reconnecter", flash[:error]
assert_equal :fr, current_language
end
end
def test_anonymous_session_should_not_be_reset
with_settings :session_lifetime => '720', :session_timeout => '60' do
get :index