diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-05-31 05:17:26 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-05-31 05:25:35 +0300 |
commit | a602df303175aaaf1d5b60a2c009f5e259d187db (patch) | |
tree | 68eb6241dfbd4ccc8ae8474b73ead87018e92386 /spec/support/login_helpers.rb | |
parent | de20bd5b31715f096db3fb0155c82b0eea992b6c (diff) |
Pass the "Remember me" value to the 2FA token form
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/support/login_helpers.rb')
-rw-r--r-- | spec/support/login_helpers.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb index cd9fdc6f18e..7a0f078c72b 100644 --- a/spec/support/login_helpers.rb +++ b/spec/support/login_helpers.rb @@ -26,11 +26,13 @@ module LoginHelpers # Internal: Login as the specified user # - # user - User instance to login with - def login_with(user) + # user - User instance to login with + # remember - Whether or not to check "Remember me" (default: false) + def login_with(user, remember: false) visit new_user_session_path fill_in "user_login", with: user.email fill_in "user_password", with: "12345678" + check 'user_remember_me' if remember click_button "Sign in" Thread.current[:current_user] = user end |