mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
quick comment touch-ups
This commit is contained in:
parent
48ed2fd1aa
commit
e9c82472ff
6 changed files with 10 additions and 9 deletions
|
@ -18,7 +18,7 @@ if defined?(ActionMailer)
|
||||||
end
|
end
|
||||||
|
|
||||||
def password_change(record, opts={})
|
def password_change(record, opts={})
|
||||||
devise_mail(record, :unlock_instructions)
|
devise_mail(record, :password_change, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<p>Hello <%= @resource.email %>!</p>
|
<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
|
mattr_accessor :pepper
|
||||||
@@pepper = nil
|
@@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
|
mattr_accessor :send_password_change_notification
|
||||||
@@send_password_change_notification = false
|
@@send_password_change_notification = false
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ Devise.setup do |config|
|
||||||
# Setup a pepper to generate the encrypted password.
|
# Setup a pepper to generate the encrypted password.
|
||||||
# config.pepper = '<%= SecureRandom.hex(64) %>'
|
# 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
|
# config.send_password_change_notification = false
|
||||||
|
|
||||||
# ==> Configuration for :confirmable
|
# ==> Configuration for :confirmable
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<p>Hello <%= @resource.email %>!</p>
|
<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
|
end
|
||||||
|
|
||||||
test 'should email on password change when configured' do
|
test 'should email on password change when configured' do
|
||||||
User.stubs(:send_password_change_notification).returns(true)
|
swap Devise, send_password_change_notification: true do
|
||||||
user = create_user
|
user = create_user
|
||||||
assert_email_sent user.email do
|
assert_email_sent user.email do
|
||||||
assert user.update_attributes(password: 'newpass', password_confirmation: 'newpass')
|
assert user.update_attributes(password: 'newpass', password_confirmation: 'newpass')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue