Commit 95247d45 authored by Robert Speicher's avatar Robert Speicher

Change to sign_in / sign_out helpers for EE-specific cases

parent 69bafbc7
......@@ -6,7 +6,7 @@ describe 'Admin::AuditLogs', feature: true, js: true do
let(:user) { create(:user) }
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe 'user events' do
......
require 'spec_helper'
describe "Admin::Emails", feature: true, js: true do
let!(:current_user) { gitlab_sign_in :admin }
let!(:current_user) { create(:admin) }
let!(:group) { create(:group) }
let!(:project) { create(:project, namespace: group) }
describe "GET /admin/email" do
before do
sign_in(current_user)
visit admin_email_path
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature "License Admin", feature: true do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe '#show' do
......
......@@ -10,7 +10,7 @@ describe 'Board with milestone', :feature, :js do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
context 'new board' do
......
......@@ -11,7 +11,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_boards_path(project.namespace, project)
wait_for_requests
......
......@@ -9,7 +9,7 @@ feature 'CI shared runner settings', feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
gitlab_sign_in(admin)
sign_in(admin)
end
context 'without global shared runners quota' do
......
......@@ -6,7 +6,7 @@ feature 'CI shared runner limits', feature: true do
let(:group) { create(:group) }
before do
gitlab_sign_in(user)
sign_in(user)
end
context 'when project member' do
......
......@@ -9,7 +9,7 @@ feature 'Global elastic search', feature: true do
Gitlab::Elastic::Helper.create_empty_index
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
after do
......
......@@ -21,7 +21,7 @@ feature 'Group elastic search', js: true, feature: true do
project.team << [user, :master]
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
end
after do
......
......@@ -7,7 +7,7 @@ feature 'Groups > Contribution Analytics', js: true, feature: true do
before do
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
end
describe 'visit Contribution Analytics page for group' do
......
......@@ -8,7 +8,7 @@ feature 'Groups > Audit Events', js: true, feature: true do
before do
group.add_owner(user)
group.add_developer(pete)
gitlab_sign_in(user)
sign_in(user)
end
describe 'changing a user access level' do
......
......@@ -17,7 +17,7 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels', featu
# We need to actually activate the LDAP config otherwise `Group#ldap_synced?` will always be false!
allow(Gitlab.config.ldap).to receive_messages(enabled: true)
gitlab_sign_in(owner)
sign_in(owner)
end
scenario 'override not available on project members page', js: true do
......
......@@ -7,7 +7,7 @@ feature 'Groups > Pipeline Quota', feature: true do
before do
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
end
context 'with no quota' do
......
......@@ -14,7 +14,7 @@ describe 'Related issues', feature: true, js: true do
context 'when user has no permission to update related issues' do
before do
gitlab_sign_in(user)
sign_in(user)
end
context 'with related_issues enabled' do
......@@ -59,7 +59,7 @@ describe 'Related issues', feature: true, js: true do
before do
project.add_master(user)
project_b.add_master(user)
gitlab_sign_in(user)
sign_in(user)
end
context 'with related_issues disabled' do
......
......@@ -9,7 +9,7 @@ describe 'Issues csv', feature: true do
let!(:issue) { create(:issue, project: project, author: user) }
before do
gitlab_sign_in(user)
sign_in(user)
end
def request_csv(params = {})
......
......@@ -26,7 +26,7 @@ describe 'Dropdown weight', js: true, feature: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -18,7 +18,7 @@ describe 'Filter issues weight', js: true, feature: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
label = create(:label, project: project, title: 'urgent')
milestone = create(:milestone, title: 'version1', project: project)
......
......@@ -16,7 +16,7 @@ describe 'New/edit issue (EE)', :feature, :js do
before do
project.team << [user, :master]
project.team << [user2, :master]
gitlab_sign_in(user)
sign_in(user)
end
context 'new issue' do
......
......@@ -6,7 +6,7 @@ describe 'Issues sub nav EE', :feature do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_issues_path(project.namespace, project)
end
......
......@@ -155,8 +155,8 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
let(:guest) { create(:user) }
before do
project.team << [guest, :guest]
gitlab_sign_out
gitlab_sign_in(guest)
sign_out(:user)
sign_in(guest)
visit namespace_project_issue_path(project.namespace, project, issue)
end
......@@ -193,8 +193,8 @@ feature 'Issues > User uses quick actions', feature: true, js: true do
let(:guest) { create(:user) }
before do
project.team << [guest, :guest]
gitlab_sign_out
gitlab_sign_in(guest)
sign_out(:user)
sign_in(guest)
visit namespace_project_issue_path(project.namespace, project, issue)
end
......
......@@ -12,7 +12,7 @@ feature 'Merge request approvals', js: true, feature: true do
project.add_developer(user)
project.add_developer(author)
gitlab_sign_in(user)
sign_in(user)
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
find('#s2id_merge_request_approver_ids .select2-input').click
......@@ -39,7 +39,7 @@ feature 'Merge request approvals', js: true, feature: true do
project.add_developer(user)
project.add_developer(other_user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_new_merge_request_path(forked_project.namespace, forked_project, merge_request: { target_branch: 'master', source_branch: 'feature' })
find('#s2id_merge_request_approver_ids .select2-input').click
......@@ -66,7 +66,7 @@ feature 'Merge request approvals', js: true, feature: true do
project.add_developer(user)
project.add_developer(other_user)
gitlab_sign_in(user)
sign_in(user)
end
it 'allows setting groups as approvers' do
......@@ -120,7 +120,7 @@ feature 'Merge request approvals', js: true, feature: true do
before do
project.add_developer(user)
gitlab_sign_in(user)
sign_in(user)
end
it 'allows setting groups as approvers' do
......@@ -207,7 +207,7 @@ feature 'Merge request approvals', js: true, feature: true do
group.add_developer(other_user)
group.add_developer(user)
gitlab_sign_in(user)
sign_in(user)
end
context 'when group is assigned to a project', js: true do
......@@ -278,7 +278,7 @@ feature 'Merge request approvals', js: true, feature: true do
before do
project.add_developer(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_new_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature' })
......
......@@ -86,7 +86,7 @@ feature 'Edit Merge Request', feature: true do
end
def visit_edit_mr_page
gitlab_sign_in(user)
sign_in(user)
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
end
......
......@@ -13,7 +13,7 @@ feature 'Merge With Push Rules Validation', feature: true, js: true do
let(:push_rule) { create(:push_rule, :commit_message) }
before do
gitlab_sign_in user
sign_in user
visit_merge_request(merge_request)
end
......@@ -28,7 +28,7 @@ feature 'Merge With Push Rules Validation', feature: true, js: true do
let(:push_rule) { create(:push_rule, :author_email) }
before do
gitlab_sign_in user
sign_in user
visit_merge_request(merge_request)
end
......
......@@ -48,7 +48,7 @@ feature 'Squashing merge requests', js: true, feature: true do
allow_any_instance_of(MergeRequest).to receive(:force_remove_source_branch?).and_return(false)
project.team << [user, :master]
gitlab_sign_in user
sign_in user
end
context 'when the MR has only one commit' do
......
......@@ -7,7 +7,7 @@ feature 'Projects > Audit Events', js: true, feature: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
describe 'adding an SSH key' do
......
......@@ -6,7 +6,7 @@ feature 'Projects > Members > Member is removed from project', feature: true do
background do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_project_members_path(project.namespace, project)
end
......
......@@ -7,7 +7,7 @@ feature 'Project mirror', feature: true do
describe 'On a project', js: true do
before do
project.team << [user, :master]
gitlab_sign_in user
sign_in user
end
context 'with Update now button' do
......
......@@ -9,7 +9,7 @@ feature 'Path Locks', feature: true, js: true do
allow(project).to receive(:feature_available?).with(:file_lock) { true }
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit project_tree_path
end
......
......@@ -10,7 +10,7 @@ describe 'Project settings > [EE] Merge Requests', feature: true, js: true do
let(:non_member) { create(:user) }
before do
gitlab_sign_in(user)
sign_in(user)
project.team << [user, :master]
group.add_developer(user)
group.add_developer(group_member)
......
......@@ -8,7 +8,7 @@ describe 'Project settings > [EE] repository', feature: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
describe 'editing a push rule' do
......
......@@ -6,7 +6,7 @@ describe 'Service Desk Setting', js: true, feature: true do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
allow(::EE::Gitlab::ServiceDesk).to receive(:enabled?).with(project: project).and_return(true)
allow(::Gitlab::IncomingEmail).to receive(:enabled?) { true }
......
......@@ -7,7 +7,7 @@ feature 'Triggers', feature: true, js: true do
let(:guest_user) { create(:user) }
before do
gitlab_sign_in(user)
sign_in(user)
@project = create(:empty_project)
@project.team << [user, :master]
......
......@@ -18,7 +18,7 @@ shared_examples 'project features apply to issuables' do |klass|
before do
_ = issuable
gitlab_sign_in(user) if user
sign_in(user) if user
visit path
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment