mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 00:58:18 +00:00
Reduce RSpec/MultipleExpectations
in captcha feature spec (#29226)
This commit is contained in:
parent
4b7f04e3ea
commit
a9f9b0097b
|
@ -19,12 +19,10 @@ describe 'email confirmation flow when captcha is enabled' do
|
|||
# It presents the user with a captcha form
|
||||
expect(page).to have_title(I18n.t('auth.captcha_confirmation.title'))
|
||||
|
||||
# It does not confirm the user just yet
|
||||
expect(user.reload.confirmed?).to be false
|
||||
|
||||
# It redirects to app and confirms user
|
||||
click_on I18n.t('challenge.confirm')
|
||||
expect(user.reload.confirmed?).to be true
|
||||
expect { click_on I18n.t('challenge.confirm') }
|
||||
.to change { user.reload.confirmed? }.from(false).to(true)
|
||||
|
||||
expect(page).to have_current_path(/\A#{client_app.confirmation_redirect_uri}/, url: true)
|
||||
|
||||
# Browsers will generally reload the original page upon redirection
|
||||
|
@ -32,8 +30,9 @@ describe 'email confirmation flow when captcha is enabled' do
|
|||
visit "/auth/confirmation?confirmation_token=#{user.confirmation_token}&redirect_to_app=true"
|
||||
|
||||
# It presents a page with a link to the app callback
|
||||
expect(page).to have_content(I18n.t('auth.confirmations.registration_complete', domain: 'cb6e6126.ngrok.io'))
|
||||
expect(page).to have_link(I18n.t('auth.confirmations.clicking_this_link'), href: client_app.confirmation_redirect_uri)
|
||||
expect(page)
|
||||
.to have_content(I18n.t('auth.confirmations.registration_complete', domain: 'cb6e6126.ngrok.io'))
|
||||
.and have_link(I18n.t('auth.confirmations.clicking_this_link'), href: client_app.confirmation_redirect_uri)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue