summaryrefslogtreecommitdiff
path: root/spec/features/login_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-05-30 22:17:26 -0400
committerRobert Speicher <rspeicher@gmail.com>2016-05-30 22:25:35 -0400
commita602df303175aaaf1d5b60a2c009f5e259d187db (patch)
tree68eb6241dfbd4ccc8ae8474b73ead87018e92386 /spec/features/login_spec.rb
parentde20bd5b31715f096db3fb0155c82b0eea992b6c (diff)
downloadgitlab-ce-a602df303175aaaf1d5b60a2c009f5e259d187db.tar.gz
Pass the "Remember me" value to the 2FA token formrs-remember-me-2fa
Prior, if a user had 2FA enabled and checked the "Remember me" field, the setting was ignored because the OTP input was on a new form and the value was never passed. Closes #18000
Diffstat (limited to 'spec/features/login_spec.rb')
-rw-r--r--spec/features/login_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb
index 8c38dd5b122..a7dc3b2701b 100644
--- a/spec/features/login_spec.rb
+++ b/spec/features/login_spec.rb
@@ -32,7 +32,7 @@ feature 'Login', feature: true do
let(:user) { create(:user, :two_factor) }
before do
- login_with(user)
+ login_with(user, remember: true)
expect(page).to have_content('Two-factor Authentication')
end
@@ -52,6 +52,12 @@ feature 'Login', feature: true do
expect(current_path).to eq root_path
end
+ it 'persists remember_me value via hidden field' do
+ field = first('input#user_remember_me', visible: false)
+
+ expect(field.value).to eq '1'
+ end
+
it 'blocks login with invalid code' do
enter_code('foo')
expect(page).to have_content('Invalid two-factor code')