Commit 56f85d29 authored by blackst0ne's avatar blackst0ne

Update user_creates_merge_request_spec.rb

parent 026d290e
......@@ -3,7 +3,6 @@ require "spec_helper"
describe "User creates a merge request", :js do
include ProjectForksHelper
<<<<<<< HEAD
let(:approver) { create(:user) }
let(:project) do
create(:project,
......@@ -13,10 +12,6 @@ describe "User creates a merge request", :js do
end
let(:template_text) { "This merge request should contain the following." }
let(:title) { "Some feature" }
=======
let(:title) { "Some feature" }
let(:project) { create(:project, :repository) }
>>>>>>> upstream/master
let(:user) { create(:user) }
let(:user2) { create(:user) }
......@@ -24,17 +19,12 @@ describe "User creates a merge request", :js do
project.add_master(user)
project.add_master(approver)
sign_in(user)
end
<<<<<<< HEAD
project.approvers.create(user_id: approver.id)
=======
it "creates a merge request" do
>>>>>>> upstream/master
visit(project_new_merge_request_path(project))
end
<<<<<<< HEAD
it "creates a merge request" do
allow_any_instance_of(Gitlab::AuthorityAnalyzer).to receive(:calculate).and_return([user2])
......@@ -73,46 +63,8 @@ describe "User creates a merge request", :js do
page.within(".js-issuable-actions") do
click_link("Edit", match: :first)
=======
find(".js-source-branch").click
click_link("fix")
find(".js-target-branch").click
click_link("feature")
click_button("Compare branches")
fill_in("Title", with: title)
click_button("Submit merge request")
page.within(".merge-request") do
expect(page).to have_content(title)
>>>>>>> upstream/master
end
end
context "to a forked project" do
let(:forked_project) { fork_project(project, user, namespace: user.namespace, repository: true) }
it "creates a merge request" do
visit(project_new_merge_request_path(forked_project))
expect(page).to have_content("Source branch").and have_content("Target branch")
expect(find("#merge_request_target_project_id", visible: false).value).to eq(project.id.to_s)
click_button("Compare branches and continue")
expect(page).to have_content("You must select source and target branch")
first(".js-source-project").click
first(".dropdown-source-project a", text: forked_project.full_path)
first(".js-target-project").click
first(".dropdown-target-project a", text: project.full_path)
first(".js-source-branch").click
<<<<<<< HEAD
page.within("ul.approver-list") do
expect(page).to have_content(user2.name)
end
......@@ -139,8 +91,6 @@ describe "User creates a merge request", :js do
first(".js-source-branch").click
=======
>>>>>>> upstream/master
wait_for_requests
source_branch = "fix"
......
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