summaryrefslogtreecommitdiff
path: root/spec/features/u2f_spec.rb
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2016-08-19 18:51:56 -0700
committerDJ Mountney <david@twkie.net>2016-09-01 17:11:42 -0700
commit9224f031cfcb8283566f9d1dcc336ae644faf062 (patch)
tree4c2012f873b24bd30b6fdea0807cae6d3fe43f4e /spec/features/u2f_spec.rb
parent33a367e828c95ba7321d33361be67c68b1603bdd (diff)
downloadgitlab-ce-9224f031cfcb8283566f9d1dcc336ae644faf062.tar.gz
Pass the remember_me option into the u2f form and support it while authenticatingadd-remember-option-u2f
Matches the changes done for non-u2f two-factor auth
Diffstat (limited to 'spec/features/u2f_spec.rb')
-rw-r--r--spec/features/u2f_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb
index a46e48c76ed..ff6933dc8d9 100644
--- a/spec/features/u2f_spec.rb
+++ b/spec/features/u2f_spec.rb
@@ -156,6 +156,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', feature:
describe "when 2FA via OTP is disabled" do
it "allows logging in with the U2F device" do
+ user.update_attribute(:otp_required_for_login, false)
login_with(user)
@u2f_device.respond_to_u2f_authentication
@@ -181,6 +182,19 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', feature:
end
end
+ it 'persists remember_me value via hidden field' do
+ login_with(user, remember: true)
+
+ @u2f_device.respond_to_u2f_authentication
+ click_on "Login Via U2F Device"
+ expect(page.body).to match('We heard back from your U2F device')
+
+ within 'div#js-authenticate-u2f' do
+ field = first('input#user_remember_me', visible: false)
+ expect(field.value).to eq '1'
+ end
+ end
+
describe "when a given U2F device has already been registered by another user" do
describe "but not the current user" do
it "does not allow logging in with that particular device" do