Commit 2a9bdcac authored by Valery Sizov's avatar Valery Sizov

Resolve another part of conflicts (CE->EE)[ci skip]

parent c8611fb2
...@@ -11,13 +11,8 @@ describe "GitLab Flavored Markdown", feature: true do ...@@ -11,13 +11,8 @@ describe "GitLab Flavored Markdown", feature: true do
end end
before do before do
<<<<<<< HEAD
gitlab_sign_in(:user)
project.add_developer(@user)
=======
sign_in(user) sign_in(user)
project.add_developer(user) project.add_developer(user)
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
end end
describe "for commits" do describe "for commits" do
......
...@@ -9,11 +9,7 @@ describe 'Issues', feature: true do ...@@ -9,11 +9,7 @@ describe 'Issues', feature: true do
let(:project) { create(:empty_project, :public) } let(:project) { create(:empty_project, :public) }
before do before do
<<<<<<< HEAD
gitlab_sign_in :user
=======
sign_in(user) sign_in(user)
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
user2 = create(:user) user2 = create(:user)
project.team << [[user, user2], :developer] project.team << [[user, user2], :developer]
...@@ -503,13 +499,8 @@ describe 'Issues', feature: true do ...@@ -503,13 +499,8 @@ describe 'Issues', feature: true do
end end
it 'shows assignee text', js: true do it 'shows assignee text', js: true do
<<<<<<< HEAD
gitlab_sign_out
gitlab_sign_in guest
=======
sign_out(:user) sign_out(:user)
sign_in(guest) sign_in(guest)
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
expect(page).to have_content issue.assignees.first.name expect(page).to have_content issue.assignees.first.name
...@@ -592,13 +583,8 @@ describe 'Issues', feature: true do ...@@ -592,13 +583,8 @@ describe 'Issues', feature: true do
end end
it 'shows milestone text', js: true do it 'shows milestone text', js: true do
<<<<<<< HEAD
gitlab_sign_out
gitlab_sign_in guest
=======
sign_out(:user) sign_out(:user)
sign_in(guest) sign_in(guest)
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
expect(page).to have_content milestone.title expect(page).to have_content milestone.title
...@@ -611,11 +597,7 @@ describe 'Issues', feature: true do ...@@ -611,11 +597,7 @@ describe 'Issues', feature: true do
context 'by unauthenticated user' do context 'by unauthenticated user' do
before do before do
<<<<<<< HEAD
gitlab_sign_out
=======
sign_out(:user) sign_out(:user)
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
end end
it 'redirects to signin then back to new issue after signin' do it 'redirects to signin then back to new issue after signin' do
...@@ -625,13 +607,9 @@ describe 'Issues', feature: true do ...@@ -625,13 +607,9 @@ describe 'Issues', feature: true do
expect(current_path).to eq new_user_session_path expect(current_path).to eq new_user_session_path
<<<<<<< HEAD
gitlab_sign_in :user
=======
# NOTE: This is specifically testing the redirect after login, so we # NOTE: This is specifically testing the redirect after login, so we
# need the full login flow # need the full login flow
gitlab_sign_in(create(:user)) gitlab_sign_in(create(:user))
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
expect(current_path).to eq new_namespace_project_issue_path(project.namespace, project) expect(current_path).to eq new_namespace_project_issue_path(project.namespace, project)
end end
......
...@@ -5,16 +5,9 @@ feature 'Edit Merge Request', feature: true do ...@@ -5,16 +5,9 @@ feature 'Edit Merge Request', feature: true do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:merge_request) { create(:merge_request, :simple, source_project: project) } let(:merge_request) { create(:merge_request, :simple, source_project: project) }
<<<<<<< HEAD
context 'editing a MR' do context 'editing a MR' do
before do before do
project.team << [user, :master] project.team << [user, :master]
=======
before do
project.team << [user, :master]
gitlab_sign_in user
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
visit_edit_mr_page visit_edit_mr_page
end end
......
require 'rails_helper'
describe 'Milestone draggable', feature: true, js: true do
include DragTo
let(:milestone) { create(:milestone, project: project, title: 8.14) }
let(:project) { create(:empty_project, :public) }
let(:user) { create(:user) }
context 'issues' do
let(:issue) { page.find_by_id('issues-list-unassigned').find('li') }
let(:issue_target) { page.find_by_id('issues-list-ongoing') }
it 'does not allow guest to drag issue' do
create_and_drag_issue
expect(issue_target).not_to have_selector('.issuable-row')
end
it 'does not allow authorized user to drag issue' do
gitlab_sign_in(user)
create_and_drag_issue
expect(issue_target).not_to have_selector('.issuable-row')
end
it 'allows author to drag issue' do
gitlab_sign_in(user)
create_and_drag_issue(author: user)
expect(issue_target).to have_selector('.issuable-row')
end
it 'allows admin to drag issue' do
gitlab_sign_in(:admin)
create_and_drag_issue
expect(issue_target).to have_selector('.issuable-row')
end
it 'assigns issue when it has been dragged to ongoing list' do
login_as(:admin)
create_and_drag_issue
expect(@issue.reload.assignees).not_to be_empty
expect(page).to have_selector("#sortable_issue_#{@issue.iid} .assignee-icon img", count: 1)
end
end
context 'merge requests' do
let(:merge_request) { page.find_by_id('merge_requests-list-unassigned').find('li') }
let(:merge_request_target) { page.find_by_id('merge_requests-list-ongoing') }
it 'does not allow guest to drag merge request' do
create_and_drag_merge_request
expect(merge_request_target).not_to have_selector('.issuable-row')
end
it 'does not allow authorized user to drag merge request' do
gitlab_sign_in(user)
create_and_drag_merge_request
expect(merge_request_target).not_to have_selector('.issuable-row')
end
it 'allows author to drag merge request' do
gitlab_sign_in(user)
create_and_drag_merge_request(author: user)
expect(merge_request_target).to have_selector('.issuable-row')
end
it 'allows admin to drag merge request' do
gitlab_sign_in(:admin)
create_and_drag_merge_request
expect(merge_request_target).to have_selector('.issuable-row')
end
end
def create_and_drag_issue(params = {})
@issue = create(:issue, params.merge(title: 'Foo', project: project, milestone: milestone))
visit namespace_project_milestone_path(project.namespace, project, milestone)
scroll_into_view('.milestone-content')
drag_to(selector: '.issues-sortable-list', list_to_index: 1)
wait_for_requests
end
def create_and_drag_merge_request(params = {})
create(:merge_request, params.merge(title: 'Foo', source_project: project, target_project: project, milestone: milestone))
visit namespace_project_milestone_path(project.namespace, project, milestone)
page.find("a[href='#tab-merge-requests']").click
wait_for_requests
scroll_into_view('.milestone-content')
drag_to(selector: '.merge_requests-sortable-list', list_to_index: 1)
wait_for_requests
end
def scroll_into_view(selector)
page.evaluate_script("document.querySelector('#{selector}').scrollIntoView();")
end
end
...@@ -8,11 +8,7 @@ describe 'Milestone show', feature: true do ...@@ -8,11 +8,7 @@ describe 'Milestone show', feature: true do
let(:issue_params) { { project: project, assignees: [user], author: user, milestone: milestone, labels: labels } } let(:issue_params) { { project: project, assignees: [user], author: user, milestone: milestone, labels: labels } }
before do before do
<<<<<<< HEAD
project.add_user(user, :developer)
=======
project.add_user(user, :developer) project.add_user(user, :developer)
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
gitlab_sign_in(user) gitlab_sign_in(user)
end end
......
require 'spec_helper' require 'spec_helper'
describe 'Branches', feature: true do describe 'Branches', feature: true do
<<<<<<< HEAD
include ProtectedBranchHelpers include ProtectedBranchHelpers
=======
let(:user) { create(:user) } let(:user) { create(:user) }
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:repository) { project.repository } let(:repository) { project.repository }
context 'logged in as developer' do context 'logged in as developer' do
before do before do
<<<<<<< HEAD
gitlab_sign_in :user
project.team << [@user, :developer]
=======
sign_in(user) sign_in(user)
project.team << [user, :developer] project.team << [user, :developer]
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
end end
describe 'Initial branches page' do describe 'Initial branches page' do
...@@ -94,13 +86,8 @@ describe 'Branches', feature: true do ...@@ -94,13 +86,8 @@ describe 'Branches', feature: true do
context 'logged in as master' do context 'logged in as master' do
before do before do
<<<<<<< HEAD
gitlab_sign_in :user
project.team << [@user, :master]
=======
sign_in(user) sign_in(user)
project.team << [user, :master] project.team << [user, :master]
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
end end
describe 'Delete protected branch' do describe 'Delete protected branch' do
......
...@@ -8,13 +8,8 @@ describe 'Cherry-pick Commits' do ...@@ -8,13 +8,8 @@ describe 'Cherry-pick Commits' do
let(:master_pickable_merge) { project.commit('e56497bb5f03a90a51293fc6d516788730953899') } let(:master_pickable_merge) { project.commit('e56497bb5f03a90a51293fc6d516788730953899') }
before do before do
<<<<<<< HEAD
gitlab_sign_in :user
project.team << [@user, :master]
=======
sign_in(user) sign_in(user)
project.team << [user, :master] project.team << [user, :master]
>>>>>>> bf57a7e80c44080dc7ec0fd774148afdae29cc31
visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id) visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id)
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