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