diff options
author | Go MAEDA <maeda@farend.jp> | 2017-12-08 08:27:27 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2017-12-08 08:27:27 +0000 |
commit | 01085249abeed47f56d13434f47f11bccca0fb40 (patch) | |
tree | 55f0f2a2c986b086e35a48a579dc9bf39cfc2e02 /test | |
parent | 4e7ae640b98fd28315734988bc6659e231e0efa8 (diff) | |
download | redmine-01085249abeed47f56d13434f47f11bccca0fb40.tar.gz redmine-01085249abeed47f56d13434f47f11bccca0fb40.zip |
Fix: Strip whitespace from email addresses on lost password page (#27754).
Patch by Felix Schäfer.
git-svn-id: http://svn.redmine.org/redmine/trunk@17078 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/account_controller_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 7850a9a0d..d25a00331 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -385,6 +385,21 @@ class AccountControllerTest < Redmine::ControllerTest end end + def test_lost_password_with_whitespace_should_send_email_to_the_address + Token.delete_all + + assert_difference 'ActionMailer::Base.deliveries.size' do + assert_difference 'Token.count' do + post :lost_password, params: { + mail: ' JSmith@somenet.foo ' + } + assert_redirected_to '/login' + end + end + mail = ActionMailer::Base.deliveries.last + assert_equal ['jsmith@somenet.foo'], mail.bcc + 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 |