1
0
Fork 0
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:
Jon Phenow 2015-06-24 10:50:43 -05:00
parent 48ed2fd1aa
commit e9c82472ff
6 changed files with 10 additions and 9 deletions

View file

@ -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

View file

@ -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>

View file

@ -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

View file

@ -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

View file

@ -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>

View file

@ -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