fix: Update the link used for email address change in the confirmation mail (#5937)

This commit is contained in:
OMAR.A
2022-12-06 02:17:27 +02:00
committed by GitHub
parent 06434bc655
commit a82b9991b3
2 changed files with 19 additions and 2 deletions

View File

@@ -63,6 +63,21 @@ RSpec.describe 'Confirmation Instructions', type: :mailer do
end
end
context 'when user is confirmed and updates the email' do
before do
confirmable_user.confirm
confirmable_user.update!(email: 'user@example.com')
end
it 'sends a confirmation link' do
confirmation_mail = Devise::Mailer.confirmation_instructions(confirmable_user.reload, nil, {})
expect(confirmation_mail.body).to include('app/auth/confirmation?confirmation_token')
expect(confirmation_mail.body).not_to include('app/auth/password/edit')
expect(confirmable_user.unconfirmed_email.blank?).to be false
end
end
context 'when user already confirmed' do
before do
confirmable_user.confirm