quick comment touch-ups
This commit is contained in:
parent
48ed2fd1aa
commit
e9c82472ff
|
@ -18,7 +18,7 @@ if defined?(ActionMailer)
|
|||
end
|
||||
|
||||
def password_change(record, opts={})
|
||||
devise_mail(record, :unlock_instructions)
|
||||
devise_mail(record, :password_change, opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>We're contacting you to notify you that you're password has been changed.</p>
|
||||
<p>We're contacting you to notify you that your password has been changed.</p>
|
||||
|
|
|
@ -150,7 +150,7 @@ module Devise
|
|||
mattr_accessor :pepper
|
||||
@@pepper = nil
|
||||
|
||||
# Used to encrypt password. Please generate one with rake secret.
|
||||
# Used to enable sending notification to user when their password is changed
|
||||
mattr_accessor :send_password_change_notification
|
||||
@@send_password_change_notification = false
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ Devise.setup do |config|
|
|||
# Setup a pepper to generate the encrypted password.
|
||||
# config.pepper = '<%= SecureRandom.hex(64) %>'
|
||||
|
||||
# Send a notification email on password change
|
||||
# Send a notification email when the user's password is changed
|
||||
# config.send_password_change_notification = false
|
||||
|
||||
# ==> Configuration for :confirmable
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>We're contacting you to notify you that you're password has been changed.</p>
|
||||
<p>We're contacting you to notify you that your password has been changed.</p>
|
||||
|
|
|
@ -237,10 +237,11 @@ class DatabaseAuthenticatableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test 'should email on password change when configured' do
|
||||
User.stubs(:send_password_change_notification).returns(true)
|
||||
user = create_user
|
||||
assert_email_sent user.email do
|
||||
assert user.update_attributes(password: 'newpass', password_confirmation: 'newpass')
|
||||
swap Devise, send_password_change_notification: true do
|
||||
user = create_user
|
||||
assert_email_sent user.email do
|
||||
assert user.update_attributes(password: 'newpass', password_confirmation: 'newpass')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue