diff options
author | Shinya Maeda <shinya@gitlab.com> | 2019-06-26 19:24:09 +0700 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2019-07-05 13:19:30 +0700 |
commit | 587ffd11480db3ed492459ec2b6fac32a459ebaa (patch) | |
tree | f695dba44247ea39cf3cbd53b33943880cbb6659 /spec/services/system_note_service_spec.rb | |
parent | 9414a41f8390511005702ab4fec99239b6c3c6dd (diff) | |
download | gitlab-ce-587ffd11480db3ed492459ec2b6fac32a459ebaa.tar.gz |
Split AutoMergeService interfaces into two `cancel` and `abort`make-explicit-endpoint-abort-in-auto-merge-ce
Create explicit endpoint - abort.
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r-- | spec/services/system_note_service_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 9f60e49290e..2d33e1c37eb 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -359,6 +359,22 @@ describe SystemNoteService do end end + describe '.abort_merge_when_pipeline_succeeds' do + let(:noteable) do + create(:merge_request, source_project: project, target_project: project) + end + + subject { described_class.abort_merge_when_pipeline_succeeds(noteable, project, author, 'merge request was closed') } + + it_behaves_like 'a system note' do + let(:action) { 'merge' } + end + + it "posts the 'merge when pipeline succeeds' system note" do + expect(subject.note).to eq "aborted the automatic merge because merge request was closed" + end + end + describe '.change_title' do let(:noteable) { create(:issue, project: project, title: 'Lorem ipsum') } |