summaryrefslogtreecommitdiff
path: root/spec/services/system_notes
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 21:08:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 21:08:48 +0000
commitb6ec12ceca58b12d974d46d0579742f4d3cdb9d7 (patch)
treec440d6195c651bac465cd37bc0d88fbd3ebefccc /spec/services/system_notes
parent3832718d895bf8268f3e3aac85948e2792769345 (diff)
downloadgitlab-ce-b6ec12ceca58b12d974d46d0579742f4d3cdb9d7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/system_notes')
-rw-r--r--spec/services/system_notes/merge_requests_service_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/services/system_notes/merge_requests_service_spec.rb b/spec/services/system_notes/merge_requests_service_spec.rb
index 6d2473e8c03..2a04e888ae0 100644
--- a/spec/services/system_notes/merge_requests_service_spec.rb
+++ b/spec/services/system_notes/merge_requests_service_spec.rb
@@ -240,4 +240,25 @@ describe ::SystemNotes::MergeRequestsService do
expect(subject.note).to eq("created merge request #{merge_request.to_reference(project)} to address this issue")
end
end
+
+ describe '.picked_into_branch' do
+ let(:branch_name) { 'a-branch' }
+ let(:commit_sha) { project.commit.sha }
+ let(:merge_request) { noteable }
+
+ subject { service.picked_into_branch(branch_name, commit_sha) }
+
+ it_behaves_like 'a system note' do
+ let(:action) { 'cherry_pick' }
+ end
+
+ it "posts the 'picked merge request' system note" do
+ expect(subject.note).to eq("picked this merge request into branch [`#{branch_name}`](/#{project.full_path}/tree/#{branch_name}) with commit #{commit_sha}")
+ end
+
+ it 'links the merge request and the cherry-pick commit' do
+ expect(subject.noteable).to eq(merge_request)
+ expect(subject.commit_id).to eq(commit_sha)
+ end
+ end
end