summaryrefslogtreecommitdiff
path: root/spec/features/merge_requests
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-07-27 15:36:39 +0100
committerSean McGivern <sean@gitlab.com>2017-07-28 16:25:13 +0100
commit75d04f6a29a5506ffd53c227517411febdc54910 (patch)
tree9e1234843c638abe5e34299d21348c5bf885a5ec /spec/features/merge_requests
parent9981814514742a2ee507d4dcc2fd71099fd96585 (diff)
downloadgitlab-ce-75d04f6a29a5506ffd53c227517411febdc54910.tar.gz
Fix replying to commit comments on MRs from forks
A commit comment shows in the MR, but if the MR is from a fork, it will have a different project ID to the MR's target project. In that case, add an note_project_id param so that we can pick the correct project for the note.
Diffstat (limited to 'spec/features/merge_requests')
-rw-r--r--spec/features/merge_requests/created_from_fork_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/features/merge_requests/created_from_fork_spec.rb b/spec/features/merge_requests/created_from_fork_spec.rb
index 9b7795ace62..d706d01dde0 100644
--- a/spec/features/merge_requests/created_from_fork_spec.rb
+++ b/spec/features/merge_requests/created_from_fork_spec.rb
@@ -25,6 +25,33 @@ feature 'Merge request created from fork' do
expect(page).to have_content 'Test merge request'
end
+ context 'when a commit comment exists on the merge request' do
+ given(:comment) { 'A commit comment' }
+ given(:reply) { 'A reply comment' }
+
+ background do
+ create(:note_on_commit, note: comment,
+ project: fork_project,
+ commit_id: merge_request.commit_shas.first)
+ end
+
+ scenario 'user can reply to the comment', js: true do
+ visit_merge_request(merge_request)
+
+ expect(page).to have_content(comment)
+
+ page.within('.discussion-notes') do
+ find('.btn-text-field').click
+ find('#note_note').send_keys(reply)
+ find('.comment-btn').click
+ end
+
+ wait_for_requests
+
+ expect(page).to have_content(reply)
+ end
+ end
+
context 'source project is deleted' do
background do
MergeRequests::MergeService.new(project, user).execute(merge_request)