Replace email_spec gem with built-in matchers (#38079)
This commit is contained in:
1 parent
5d4271a3cc
commit
4e3866dbaf
18 files changed
+231
-241
No files matched your search
@@ -24,17 +24,12 @@ RSpec.describe 'Settings TwoFactorAuthenticationMethods' do
|
||||
|
||||
# Fill in challenge form
|
||||
fill_in 'form_challenge_current_password', with: user.password
|
||||
emails = capture_emails do
|
||||
expect { click_on I18n.t('challenge.confirm') }
|
||||
.to change { user.reload.otp_required_for_login }.to(false)
|
||||
end
|
||||
expect { click_on I18n.t('challenge.confirm') }
|
||||
.to change { user.reload.otp_required_for_login }.to(false)
|
||||
.and send_email(to: user.email, subject: I18n.t('devise.mailer.two_factor_disabled.subject'))
|
||||
|
||||
expect(page)
|
||||
.to have_content(I18n.t('two_factor_authentication.disabled_success'))
|
||||
expect(emails.first)
|
||||
.to be_present
|
||||
.and(deliver_to(user.email))
|
||||
.and(have_subject(I18n.t('devise.mailer.two_factor_disabled.subject')))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user