Commit 33a8dfd0 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Make sessions controller specs more explicit

parent 00da609c
......@@ -69,7 +69,7 @@ describe SessionsController do
end
end
context ' when OTP is invalid' do
context 'when OTP is invalid' do
before { authenticate_2fa(otp_attempt: 'invalid') }
it 'does not authenticate' do
......@@ -77,8 +77,8 @@ describe SessionsController do
end
it 'warns about invalid OTP code' do
expect(response).to set_flash
.now[:alert].to /Invalid two-factor code/
expect(response).to set_flash.now[:alert]
.to /Invalid two-factor code/
end
end
end
......@@ -90,7 +90,8 @@ describe SessionsController do
authenticate_2fa(login: another_user.username,
otp_attempt: 'invalid')
expect(response).to_not set_flash.now[:alert].to /Invalid login or password/
expect(response).to set_flash.now[:alert]
.to /Invalid two-factor code/
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment