summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-08 20:41:53 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-05-09 17:32:09 -0400
commit32971b0af4761fa9527c2fa0922a9b31eec5245f (patch)
tree4f378a5ab57dc7d1a758160d1df272853a9d0400 /spec
parent6369d23d581ad36e7507d355a69237b90a912697 (diff)
downloadgitlab-ce-32971b0af4761fa9527c2fa0922a9b31eec5245f.tar.gz
Refactor SessionsController
Also adds test case for providing an invalid 2FA code and then a valid one without re-entering username and password.
Diffstat (limited to 'spec')
-rw-r--r--spec/features/login_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb
index 5ffaae54766..f1e24c54240 100644
--- a/spec/features/login_spec.rb
+++ b/spec/features/login_spec.rb
@@ -31,6 +31,14 @@ feature 'Login' do
enter_code('foo')
expect(page).to have_content('Invalid two-factor code')
end
+
+ it 'allows login with invalid code, then valid code' do
+ enter_code('foo')
+ expect(page).to have_content('Invalid two-factor code')
+
+ enter_code(user.current_otp)
+ expect(current_path).to eq root_path
+ end
end
context 'using backup code' do