diff options
author | Sean McGivern <sean@gitlab.com> | 2016-11-04 09:29:52 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-11-04 10:17:53 +0000 |
commit | 7108e2e75362aec227765820e116e3d7bc1ac08d (patch) | |
tree | bf980d66e324c30e5861aa28b8f028a47915a021 | |
parent | 957744dab4297f66dc70c1727fe2cf5282d2ea5a (diff) | |
download | gitlab-ce-fix-new-branch-button-spec.tar.gz |
Fix new branch button specfix-new-branch-button-spec
1. We can create the note directly on the issue, rather than attaching
it after creation.
2. We need to update the MergeRequestClosesIssues relation to ensure
that the issue know that it's closed by the MR.
3. We should also check that the unavailable button is displayed - not
just that the available button is displayed.
-rw-r--r-- | spec/features/issues/new_branch_button_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/features/issues/new_branch_button_spec.rb b/spec/features/issues/new_branch_button_spec.rb index fb0c4704285..755f4eb1b0b 100644 --- a/spec/features/issues/new_branch_button_spec.rb +++ b/spec/features/issues/new_branch_button_spec.rb @@ -18,8 +18,8 @@ feature 'Start new branch from an issue', feature: true do end context "when there is a referenced merge request" do - let(:note) do - create(:note, :on_issue, :system, project: project, + let!(:note) do + create(:note, :on_issue, :system, project: project, noteable: issue, note: "Mentioned in !#{referenced_mr.iid}") end let(:referenced_mr) do @@ -28,12 +28,13 @@ feature 'Start new branch from an issue', feature: true do end before do - issue.notes << note + referenced_mr.cache_merge_request_closes_issues!(user) visit namespace_project_issue_path(project.namespace, project, issue) end 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).to have_content /1 Related Merge Request/ end |