Check response body instead of assigns in settings 2fa recovery codes controller spec

This commit is contained in:
Matt Jankowski 2024-04-30 12:10:10 -04:00
parent a8886648f3
commit cb2f1e3d4b
1 changed files with 2 additions and 1 deletions

View File

@ -15,10 +15,11 @@ describe Settings::TwoFactorAuthentication::RecoveryCodesController do
sign_in user, scope: :user
post :create, session: { challenge_passed_at: Time.now.utc }
expect(assigns(:recovery_codes)).to eq otp_backup_codes
expect(flash[:notice]).to eq 'Recovery codes successfully regenerated'
expect(response).to have_http_status(200)
expect(response).to render_template(:index)
expect(response.body)
.to include(*otp_backup_codes)
end
it 'redirects when not signed in' do