mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Check response body instead of assigns in settings 2fa confirmations controller spec
This commit is contained in:
parent
f7574c42db
commit
7eee1d9bc4
1 changed files with 8 additions and 3 deletions
|
@ -9,11 +9,16 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do
|
|||
it 'renders the new view' do
|
||||
subject
|
||||
|
||||
expect(assigns(:confirmation)).to be_instance_of Form::TwoFactorConfirmation
|
||||
expect(assigns(:provision_url)).to eq 'otpauth://totp/cb6e6126.ngrok.io:local-part%40domain?secret=thisisasecretforthespecofnewview&issuer=cb6e6126.ngrok.io'
|
||||
expect(assigns(:qrcode)).to be_instance_of RQRCode::QRCode
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response).to render_template(:new)
|
||||
expect(response.body)
|
||||
.to include(qr_code_markup)
|
||||
end
|
||||
|
||||
def qr_code_markup
|
||||
RQRCode::QRCode.new(
|
||||
'otpauth://totp/cb6e6126.ngrok.io:local-part%40domain?secret=thisisasecretforthespecofnewview&issuer=cb6e6126.ngrok.io'
|
||||
).as_svg(padding: 0, module_size: 4)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue