Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-09 15:56:26 +0300
committerDouwe Maan <douwe@gitlab.com>2015-12-09 15:56:26 +0300
commit73c59de0621010681197ebe7bfaed7f3eb03050d (patch)
treef84dcde56073325ea98116f04e0f3710913291e3 /spec/services/system_note_service_spec.rb
parent6c6fb1d8bb2c6aa44553ebf35496d64ff6b202d2 (diff)
parent9bfd6c44e23754b6f699586f6a0cec2879e107e0 (diff)
Merge branch 'master' into split-up-builds
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r--spec/services/system_note_service_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index 19f63323187..0a4f9b230e8 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -207,6 +207,32 @@ describe SystemNoteService, services: true do
end
end
+ describe '.merge_when_build_succeeds' do
+ let(:ci_commit) { build :ci_commit_without_jobs }
+ let(:noteable) { create :merge_request }
+
+ subject { described_class.merge_when_build_succeeds(noteable, project, author, noteable.last_commit) }
+
+ it_behaves_like 'a system note'
+
+ it "posts the Merge When Build Succeeds system note" do
+ expect(subject.note).to match /Enabled an automatic merge when the build for (\w+\/\w+@)?[0-9a-f]{40} succeeds/
+ end
+ end
+
+ describe '.cancel_merge_when_build_succeeds' do
+ let(:ci_commit) { build :ci_commit_without_jobs }
+ let(:noteable) { create :merge_request }
+
+ subject { described_class.cancel_merge_when_build_succeeds(noteable, project, author) }
+
+ it_behaves_like 'a system note'
+
+ it "posts the Merge When Build Succeeds system note" do
+ expect(subject.note).to eq "Canceled the automatic merge"
+ end
+ end
+
describe '.change_title' do
subject { described_class.change_title(noteable, project, author, 'Old title') }