mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-10 07:18:14 -05:00
Separating perishable token into confirmation and reset_password tokens. Adding confirmation_sent_at attribute.
This commit is contained in:
@@ -36,7 +36,7 @@ class ConfirmationInstructionsTest < ActionMailer::TestCase
|
||||
|
||||
test 'body should have link to confirm the account' do
|
||||
host = ActionMailer::Base.default_url_options[:host]
|
||||
confirmation_url_regexp = %r{<a href=\"http://#{host}/users/confirmation\?perishable_token=#{@user.perishable_token}">}
|
||||
confirmation_url_regexp = %r{<a href=\"http://#{host}/users/confirmation\?confirmation_token=#{@user.confirmation_token}">}
|
||||
assert_match confirmation_url_regexp, @mail.body
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,8 @@ class ResetPasswordInstructionsTest < ActionMailer::TestCase
|
||||
I18n.backend.store_translations :en, {:devise => { :notifier => { :reset_password_instructions => 'Reset instructions' } }}
|
||||
Notifier.sender = 'test@example.com'
|
||||
@user = create_user
|
||||
@mail = Notifier.deliver_reset_password_instructions(@user)
|
||||
@user.send_reset_password_instructions
|
||||
@mail = ActionMailer::Base.deliveries.last
|
||||
end
|
||||
|
||||
test 'email sent after reseting the user password' do
|
||||
@@ -36,7 +37,7 @@ class ResetPasswordInstructionsTest < ActionMailer::TestCase
|
||||
|
||||
test 'body should have link to confirm the account' do
|
||||
host = ActionMailer::Base.default_url_options[:host]
|
||||
confirmation_url_regexp = %r{<a href=\"http://#{host}/users/password/edit\?perishable_token=#{@user.perishable_token}">}
|
||||
confirmation_url_regexp = %r{<a href=\"http://#{host}/users/password/edit\?reset_password_token=#{@user.reset_password_token}">}
|
||||
assert_match confirmation_url_regexp, @mail.body
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user