From 45fb1f9542fc258d8671c82843d681277ae4aa89 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 5 Jun 2017 14:44:29 -0400 Subject: Change `login_as` uses to `gitlab_sign_in` --- spec/features/u2f_spec.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'spec/features/u2f_spec.rb') diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb index dc21637967f..02696841628 100644 --- a/spec/features/u2f_spec.rb +++ b/spec/features/u2f_spec.rb @@ -25,7 +25,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do let(:user) { create(:user) } before do - login_as(user) + gitlab_sign_in(user) user.update_attribute(:otp_required_for_login, true) end @@ -96,7 +96,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do logout # Second user - user = login_as(:user) + user = gitlab_sign_in(:user) user.update_attribute(:otp_required_for_login, true) visit profile_account_path manage_two_factor_authentication @@ -147,7 +147,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do before do # Register and logout - login_as(user) + gitlab_sign_in(user) user.update_attribute(:otp_required_for_login, true) visit profile_account_path manage_two_factor_authentication @@ -195,7 +195,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do describe "but not the current user" do it "does not allow logging in with that particular device" do # Register current user with the different U2F device - current_user = login_as(:user) + current_user = gitlab_sign_in(:user) current_user.update_attribute(:otp_required_for_login, true) visit profile_account_path manage_two_factor_authentication @@ -203,7 +203,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do logout # Try authenticating user with the old U2F device - login_as(current_user) + gitlab_sign_in(current_user) @u2f_device.respond_to_u2f_authentication expect(page).to have_content('We heard back from your U2F device') expect(page).to have_content('Authentication via U2F device failed') @@ -213,7 +213,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do describe "and also the current user" do it "allows logging in with that particular device" do # Register current user with the same U2F device - current_user = login_as(:user) + current_user = gitlab_sign_in(:user) current_user.update_attribute(:otp_required_for_login, true) visit profile_account_path manage_two_factor_authentication @@ -221,7 +221,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do logout # Try authenticating user with the same U2F device - login_as(current_user) + gitlab_sign_in(current_user) @u2f_device.respond_to_u2f_authentication expect(page).to have_content('We heard back from your U2F device') @@ -233,7 +233,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do describe "when a given U2F device has not been registered" do it "does not allow logging in with that particular device" do unregistered_device = FakeU2fDevice.new(page, 'My device') - login_as(user) + gitlab_sign_in(user) unregistered_device.respond_to_u2f_authentication expect(page).to have_content('We heard back from your U2F device') @@ -244,7 +244,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do describe "when more than one device has been registered by the same user" do it "allows logging in with either device" do # Register first device - user = login_as(:user) + user = gitlab_sign_in(:user) user.update_attribute(:otp_required_for_login, true) visit profile_two_factor_auth_path expect(page).to have_content("Your U2F device needs to be set up.") @@ -258,7 +258,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do # Authenticate as both devices [first_device, second_device].each do |device| - login_as(user) + gitlab_sign_in(user) device.respond_to_u2f_authentication expect(page).to have_content('We heard back from your U2F device') @@ -273,7 +273,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do let(:user) { create(:user) } before do - user = login_as(:user) + user = gitlab_sign_in(:user) user.update_attribute(:otp_required_for_login, true) visit profile_account_path manage_two_factor_authentication @@ -300,7 +300,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do before do # Register and logout - login_as(user) + gitlab_sign_in(user) user.update_attribute(:otp_required_for_login, true) visit profile_account_path end -- cgit v1.2.1 From 018ed2c42fc946592e2b72d2e74710e509df0199 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 5 Jun 2017 14:51:54 -0400 Subject: Change `login_with` uses to `gitlab_sign_in` Change single `login_via` use to `gitlab_sign_in_via` --- spec/features/u2f_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spec/features/u2f_spec.rb') diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb index 02696841628..c2b957b2962 100644 --- a/spec/features/u2f_spec.rb +++ b/spec/features/u2f_spec.rb @@ -158,7 +158,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do 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) + gitlab_sign_in(user) @u2f_device.respond_to_u2f_authentication @@ -170,7 +170,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do describe "when 2FA via OTP is enabled" do it "allows logging in with the U2F device" do user.update_attribute(:otp_required_for_login, true) - login_with(user) + gitlab_sign_in(user) @u2f_device.respond_to_u2f_authentication @@ -180,7 +180,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do end it 'persists remember_me value via hidden field' do - login_with(user, remember: true) + gitlab_sign_in(user, remember: true) @u2f_device.respond_to_u2f_authentication expect(page).to have_content('We heard back from your U2F device') @@ -308,7 +308,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do describe 'when no u2f device is registered' do before do logout - login_with(user) + gitlab_sign_in(user) end it 'shows the fallback otp code UI' do @@ -321,7 +321,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do manage_two_factor_authentication @u2f_device = register_u2f_device logout - login_with(user) + gitlab_sign_in(user) end it 'provides a button that shows the fallback otp code UI' do -- cgit v1.2.1 From 044f09d8078ede75fa25767187d766c83c551388 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Mon, 5 Jun 2017 15:10:13 -0400 Subject: Change `logout` uses to `gitlab_sign_out` Change `logout_direct` uses to `gitlab_sign_out_direct` --- spec/features/u2f_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'spec/features/u2f_spec.rb') diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb index c2b957b2962..f3662cb184f 100644 --- a/spec/features/u2f_spec.rb +++ b/spec/features/u2f_spec.rb @@ -93,7 +93,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do manage_two_factor_authentication u2f_device = register_u2f_device expect(page).to have_content('Your U2F device was registered') - logout + gitlab_sign_out # Second user user = gitlab_sign_in(:user) @@ -152,7 +152,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do visit profile_account_path manage_two_factor_authentication @u2f_device = register_u2f_device - logout + gitlab_sign_out end describe "when 2FA via OTP is disabled" do @@ -200,7 +200,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do visit profile_account_path manage_two_factor_authentication register_u2f_device(name: 'My other device') - logout + gitlab_sign_out # Try authenticating user with the old U2F device gitlab_sign_in(current_user) @@ -218,7 +218,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do visit profile_account_path manage_two_factor_authentication register_u2f_device(@u2f_device) - logout + gitlab_sign_out # Try authenticating user with the same U2F device gitlab_sign_in(current_user) @@ -254,7 +254,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do visit profile_two_factor_auth_path expect(page).to have_content("Your U2F device needs to be set up.") second_device = register_u2f_device(name: 'My other device') - logout + gitlab_sign_out # Authenticate as both devices [first_device, second_device].each do |device| @@ -264,7 +264,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do expect(page).to have_css('.sign-out-link', visible: false) - logout + gitlab_sign_out end end end @@ -307,7 +307,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do describe 'when no u2f device is registered' do before do - logout + gitlab_sign_out gitlab_sign_in(user) end @@ -320,7 +320,7 @@ feature 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do before do manage_two_factor_authentication @u2f_device = register_u2f_device - logout + gitlab_sign_out gitlab_sign_in(user) end -- cgit v1.2.1