1
0
Fork 0
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:
Matt Jankowski 2024-04-30 12:23:54 -04:00
parent f7574c42db
commit 7eee1d9bc4

View file

@ -9,11 +9,16 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do
it 'renders the new view' do it 'renders the new view' do
subject 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 have_http_status(200)
expect(response).to render_template(:new) 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
end end