mirror of
https://github.com/redmine/redmine.git
synced 2025-11-07 22:05:56 +01:00
Security notification is not sent when an admin changes the password of a user (#32199).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@21006 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -590,6 +590,24 @@ class UsersControllerTest < Redmine::ControllerTest
|
||||
assert_mail_body_match 'newpass123', mail
|
||||
end
|
||||
|
||||
def test_update_with_password_change_by_admin_should_send_a_security_notification
|
||||
with_settings :bcc_recipients => '0' do
|
||||
ActionMailer::Base.deliveries.clear
|
||||
user = User.find_by(login: 'jsmith')
|
||||
|
||||
put :update, :params => {
|
||||
:id => user.id,
|
||||
:user => {:password => 'newpass123', :password_confirmation => 'newpass123'}
|
||||
}
|
||||
|
||||
assert_equal 1, ActionMailer::Base.deliveries.size
|
||||
mail = ActionMailer::Base.deliveries.last
|
||||
assert_equal [user.mail], mail.to
|
||||
assert_match 'Security notification', mail.subject
|
||||
assert_mail_body_match 'Your password has been changed.', mail
|
||||
end
|
||||
end
|
||||
|
||||
def test_update_with_generate_password_should_email_the_password
|
||||
ActionMailer::Base.deliveries.clear
|
||||
with_settings :bcc_recipients => '1' do
|
||||
|
||||
Reference in New Issue
Block a user