summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-07 11:45:04 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-07 13:16:48 +0200
commit33a8dfd04fbd1c0858ead20c020ede07e7b0962a (patch)
tree0c18f42b58b4091a2dc2105b68aff06ec1a9d5a7
parent00da609cfd8bf1105fe433dfc92ab263d6205eaf (diff)
downloadgitlab-ce-33a8dfd04fbd1c0858ead20c020ede07e7b0962a.tar.gz
Make sessions controller specs more explicit
-rw-r--r--spec/controllers/sessions_controller_spec.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb
index 664b23d3214..83cc8ec6d26 100644
--- a/spec/controllers/sessions_controller_spec.rb
+++ b/spec/controllers/sessions_controller_spec.rb
@@ -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