diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-05-15 20:16:53 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-05-15 20:16:53 +0800 |
commit | 47d4732fb21ffb3c172e65291eaf7633b70431ac (patch) | |
tree | 02cf8d7f927ef5c53ad05c20fb241d00b17a375c /features/steps/shared/authentication.rb | |
parent | 6fe8c1758195ca81554238bd24966bd85827b7f7 (diff) | |
parent | f4ef6b474c44eb8e7034034dd95152818ae33b4a (diff) | |
download | gitlab-ce-42531-open-invite-404.tar.gz |
Merge remote-tracking branch 'upstream/master' into 42531-open-invite-40442531-open-invite-404
* upstream/master: (53 commits)
Disable greedy mode when matching filename
Add index on runner_type for ci_runners
Improve the squash step in the 'Database Changes' MR template
Enable update_(build|pipeline) for maintainers
Correct skewed Kubernetes popover illustration
Fix minor typo of main docs page
Fix link to MR for Maintainer Access docs
Changes Ingress RBAC value to be false as default
More verbose logging for deprecated path access
Change `expect` to `except` on help page
Backport EE-specific untrusted regexp implementation
Add `createComponentWithMixin` to create anonymous components with mixin
Update secpick
Update Gemfile.rails5.lock
Remove /features
Update secpick
Increase rspec jobs up to 30
Fix specs
Add changelog entry [ci skip]
Revert clean up `db/fixtures/development/14_pipelines.rb`
...
Diffstat (limited to 'features/steps/shared/authentication.rb')
-rw-r--r-- | features/steps/shared/authentication.rb | 56 |
1 files changed, 0 insertions, 56 deletions
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 |