|
|
@ -68,7 +68,7 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do
|
|
|
|
true
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
post :create, params: { form_two_factor_confirmation: { code: '123456' } }
|
|
|
|
post :create, params: { form_two_factor_confirmation: { otp_attempt: '123456' } }
|
|
|
|
|
|
|
|
|
|
|
|
expect(assigns(:recovery_codes)).to eq otp_backup_codes
|
|
|
|
expect(assigns(:recovery_codes)).to eq otp_backup_codes
|
|
|
|
expect(flash[:notice]).to eq 'Two-factor authentication successfully enabled'
|
|
|
|
expect(flash[:notice]).to eq 'Two-factor authentication successfully enabled'
|
|
|
@ -85,7 +85,7 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do
|
|
|
|
false
|
|
|
|
false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
post :create, params: { form_two_factor_confirmation: { code: '123456' } }
|
|
|
|
post :create, params: { form_two_factor_confirmation: { otp_attempt: '123456' } }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
it 'renders the new view' do
|
|
|
|
it 'renders the new view' do
|
|
|
@ -99,7 +99,7 @@ describe Settings::TwoFactorAuthentication::ConfirmationsController do
|
|
|
|
|
|
|
|
|
|
|
|
context 'when not signed in' do
|
|
|
|
context 'when not signed in' do
|
|
|
|
it 'redirects if not signed in' do
|
|
|
|
it 'redirects if not signed in' do
|
|
|
|
post :create, params: { form_two_factor_confirmation: { code: '123456' } }
|
|
|
|
post :create, params: { form_two_factor_confirmation: { otp_attempt: '123456' } }
|
|
|
|
expect(response).to redirect_to('/auth/sign_in')
|
|
|
|
expect(response).to redirect_to('/auth/sign_in')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|