diff options
author | Simon Welsh <simon@simon.geek.nz> | 2016-06-23 20:09:54 +1000 |
---|---|---|
committer | Simon Welsh <simon@simon.geek.nz> | 2016-06-25 11:38:06 +1000 |
commit | 0550f2a5e7d8a7ed65632190b8febe2a9e01d6a0 (patch) | |
tree | 114d3ce610fdc1bdd4a4fec7d68d1b8eab14be29 /spec/services | |
parent | 2fc91c48659b84375173b038b4e7957e56294aa4 (diff) | |
download | gitlab-ce-0550f2a5e7d8a7ed65632190b8febe2a9e01d6a0.tar.gz |
Add support for "skip ci" too
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/create_commit_builds_service_spec.rb | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/spec/services/create_commit_builds_service_spec.rb b/spec/services/create_commit_builds_service_spec.rb index 2255945a1ad..309213bd44c 100644 --- a/spec/services/create_commit_builds_service_spec.rb +++ b/spec/services/create_commit_builds_service_spec.rb @@ -83,7 +83,9 @@ describe CreateCommitBuildsService, services: true do context 'when commit contains a [ci skip] directive' do let(:message) { "some message[ci skip]" } + let(:messageFlip) { "some message[skip ci]" } let(:capMessage) { "some message[CI SKIP]" } + let(:capMessageFlip) { "some message[SKIP CI]" } before do allow_any_instance_of(Ci::Pipeline).to receive(:git_commit_message) { message } @@ -97,6 +99,21 @@ describe CreateCommitBuildsService, services: true do after: '31das312', commits: commits ) + + expect(pipeline).to be_persisted + expect(pipeline.builds.any?).to be false + expect(pipeline.status).to eq("skipped") + end + + it "skips builds creation if there is [skip ci] tag in commit message" do + commits = [{ message: messageFlip }] + pipeline = service.execute(project, user, + ref: 'refs/tags/0_1', + before: '00000000', + after: '31das312', + commits: commits + ) + expect(pipeline).to be_persisted expect(pipeline.builds.any?).to be false expect(pipeline.status).to eq("skipped") @@ -116,7 +133,21 @@ describe CreateCommitBuildsService, services: true do expect(pipeline.status).to eq("skipped") end - it "does not skips builds creation if there is no [ci skip] tag in commit message" do + it "skips builds creation if there is [SKIP CI] tag in commit message" do + commits = [{ message: capMessageFlip }] + pipeline = service.execute(project, user, + ref: 'refs/tags/0_1', + before: '00000000', + after: '31das312', + commits: commits + ) + + expect(pipeline).to be_persisted + expect(pipeline.builds.any?).to be false + expect(pipeline.status).to eq("skipped") + end + + it "does not skips builds creation if there is no [ci skip] or [skip ci] tag in commit message" do allow_any_instance_of(Ci::Pipeline).to receive(:git_commit_message) { "some message" } commits = [{ message: "some message" }] |