fix: send confirmation email on re-adding agent (#5279)
Send confirmation email after re-adding the agent. Fixes: #4951
This commit is contained in:
@@ -11,6 +11,7 @@ RSpec.describe 'Confirmation Instructions', type: :mailer do
|
||||
|
||||
before do
|
||||
# to verify the token in email
|
||||
confirmable_user.update!(confirmed_at: nil)
|
||||
confirmable_user.send(:generate_confirmation_token)
|
||||
end
|
||||
|
||||
@@ -61,5 +62,17 @@ RSpec.describe 'Confirmation Instructions', type: :mailer do
|
||||
expect(confirmable_user.unconfirmed_email.blank?).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user already confirmed' do
|
||||
before do
|
||||
confirmable_user.confirm
|
||||
confirmable_user.account_users.last.destroy!
|
||||
end
|
||||
|
||||
it 'send instructions with the link to login' do
|
||||
confirmation_mail = Devise::Mailer.confirmation_instructions(confirmable_user.reload, nil, {})
|
||||
expect(confirmation_mail.body).to include('/auth/sign_in')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user