From 5d8cd87c5006f467e7c7985ce38d42b51c0bbb66 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Mon, 14 May 2018 18:55:41 +1100 Subject: Remove /features --- features/steps/shared/authentication.rb | 56 --------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 features/steps/shared/authentication.rb (limited to 'features/steps/shared/authentication.rb') diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb deleted file mode 100644 index df1428d8266..00000000000 --- a/features/steps/shared/authentication.rb +++ /dev/null @@ -1,56 +0,0 @@ -require Rails.root.join('features', 'support', 'login_helpers') - -module SharedAuthentication - include Spinach::DSL - include LoginHelpers - - step 'I sign in as a user' do - sign_out(@user) if @user - - @user = create(:user) - sign_in(@user) - end - - step 'I sign in via the UI' do - gitlab_sign_in(create(:user)) - end - - step 'I should be redirected to sign in page' do - expect(current_path).to eq new_user_session_path - end - - step "I logout directly" do - gitlab_sign_out - end - - def current_user - @user || User.reorder(nil).first - end - - private - - def gitlab_sign_in(user) - visit new_user_session_path - - fill_in "user_login", with: user.email - fill_in "user_password", with: "12345678" - check 'user_remember_me' - click_button "Sign in" - - @user = user - end - - def gitlab_sign_out - return unless @user - - if Capybara.current_driver == Capybara.javascript_driver - find('.header-user-dropdown-toggle').click - click_link 'Sign out' - expect(page).to have_button('Sign in') - else - sign_out(@user) - end - - @user = nil - end -end -- cgit v1.2.1