Commit 358e8141 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'fix-new-branch-button-spec' into 'master'

Fix new branch button spec

Closes #24089.

See merge request !7284
parents c3341884 7108e2e7
...@@ -18,8 +18,8 @@ feature 'Start new branch from an issue', feature: true do ...@@ -18,8 +18,8 @@ feature 'Start new branch from an issue', feature: true do
end end
context "when there is a referenced merge request" do context "when there is a referenced merge request" do
let(:note) do let!(:note) do
create(:note, :on_issue, :system, project: project, create(:note, :on_issue, :system, project: project, noteable: issue,
note: "Mentioned in !#{referenced_mr.iid}") note: "Mentioned in !#{referenced_mr.iid}")
end end
let(:referenced_mr) do let(:referenced_mr) do
...@@ -28,12 +28,13 @@ feature 'Start new branch from an issue', feature: true do ...@@ -28,12 +28,13 @@ feature 'Start new branch from an issue', feature: true do
end end
before do before do
issue.notes << note referenced_mr.cache_merge_request_closes_issues!(user)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
end end
it "hides the new branch button", js: true do it "hides the new branch button", js: true do
expect(page).to have_css('#new-branch .unavailable')
expect(page).not_to have_css('#new-branch .available') expect(page).not_to have_css('#new-branch .available')
expect(page).to have_content /1 Related Merge Request/ expect(page).to have_content /1 Related Merge Request/
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