summaryrefslogtreecommitdiffstats
path: root/test/functional/account_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-17 14:51:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-01-17 14:51:29 +0000
commita3a8fee8adf847f08479cf6b860417fe1f36d791 (patch)
treed40a5e442c092f27b9aa49636f5bf28d8fa5daf7 /test/functional/account_controller_test.rb
parent14473f45a16a945d22b6b0f768393057ffd0245c (diff)
downloadredmine-a3a8fee8adf847f08479cf6b860417fe1f36d791.tar.gz
redmine-a3a8fee8adf847f08479cf6b860417fe1f36d791.zip
Send password reset email to the email used in lost password form (#4244).
git-svn-id: http://svn.redmine.org/redmine/trunk@13888 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/account_controller_test.rb')
-rw-r--r--test/functional/account_controller_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb
index 8b14a2553..87c53aac3 100644
--- a/test/functional/account_controller_test.rb
+++ b/test/functional/account_controller_test.rb
@@ -304,6 +304,20 @@ class AccountControllerTest < ActionController::TestCase
end
end
+ def test_lost_password_using_additional_email_address_should_send_email_to_the_address
+ EmailAddress.create!(:user_id => 2, :address => 'anotherAddress@foo.bar')
+ Token.delete_all
+
+ assert_difference 'ActionMailer::Base.deliveries.size' do
+ assert_difference 'Token.count' do
+ post :lost_password, :mail => 'ANOTHERaddress@foo.bar'
+ assert_redirected_to '/login'
+ end
+ end
+ mail = ActionMailer::Base.deliveries.last
+ assert_equal ['anotherAddress@foo.bar'], mail.bcc
+ end
+
def test_lost_password_for_unknown_user_should_fail
Token.delete_all
assert_no_difference 'Token.count' do