Defect #44173 » 44173.patch
| app/controllers/account_controller.rb | ||
|---|---|---|
|
@user.must_change_passwd = false
|
||
|
if @user.save
|
||
|
@token.destroy
|
||
|
Mailer.deliver_password_updated(@user, User.current)
|
||
|
@user.remote_ip = request.remote_ip
|
||
|
Mailer.deliver_password_updated(@user, @user)
|
||
|
flash[:notice] = l(:notice_account_password_updated)
|
||
|
redirect_to signin_path
|
||
|
return
|
||
| test/functional/account_controller_test.rb | ||
|---|---|---|
|
user.reload
|
||
|
assert user.check_password?('newpass123')
|
||
|
assert_nil Token.find_by_id(token.id), "Token was not deleted"
|
||
|
assert_not_nil ActionMailer::Base.deliveries.last
|
||
|
assert_not_nil (mail = ActionMailer::Base.deliveries.last)
|
||
|
assert_mail_body_match '0.0.0.0', mail
|
||
|
assert_select_email do
|
||
|
assert_select 'a[href^=?]', 'http://localhost:3000/my/password', :text => 'Change password'
|
||
|
end
|
||
- « Previous
- 1
- 2
- Next »