summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-29 09:12:05 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-29 09:12:05 +0000
commita1846a2d4a3695a5e5060b0e95732850d2267567 (patch)
tree253fc90128758b2e48a6bf66137a5282614d9f03 /test
parent9e1723c537fee06503a65613398a0953b1dc0042 (diff)
downloadredmine-a1846a2d4a3695a5e5060b0e95732850d2267567.tar.gz
redmine-a1846a2d4a3695a5e5060b0e95732850d2267567.zip
Fix tests for r16287 (#24416).
git-svn-id: http://svn.redmine.org/redmine/trunk@16288 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/account_controller_test.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb
index 37a67d475..7bb6ab576 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