diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 37a67d4..7bb6ab5 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -375,11 +375,22 @@ class AccountControllerTest < Redmine::ControllerTest end end - def test_get_lost_password_with_token_should_display_the_password_recovery_form + def test_get_lost_password_with_token_should_redirect_with_token_in_session user = User.find(2) token = Token.create!(:action => 'recovery', :user => user) get :lost_password, :token => token.value + assert_redirected_to '/account/lost_password' + + assert_equal token.value, request.session[:password_recovery_token] + end + + def test_get_lost_password_with_token_in_session_should_display_the_password_recovery_form + user = User.find(2) + token = Token.create!(:action => 'recovery', :user => user) + request.session[:password_recovery_token] = token.value + + get :lost_password assert_response :success assert_select 'input[type=hidden][name=token][value=?]', token.value