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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-02 14:38:30 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-03 12:34:36 +0300
commit1bcb61dd2076995b5fed786133f94def1fd637a5 (patch)
treeee594c831d1e1ec2b41473b08b081f5996d4f2da /spec/services/create_commit_builds_service_spec.rb
parentaf2f56f8f742e00ddb298fadea763fd0fe7054f0 (diff)
Add specs covering case when there are no builds
Diffstat (limited to 'spec/services/create_commit_builds_service_spec.rb')
-rw-r--r--spec/services/create_commit_builds_service_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/create_commit_builds_service_spec.rb b/spec/services/create_commit_builds_service_spec.rb
index e643991e0b9..8c6b602ac83 100644
--- a/spec/services/create_commit_builds_service_spec.rb
+++ b/spec/services/create_commit_builds_service_spec.rb
@@ -171,5 +171,23 @@ describe CreateCommitBuildsService, services: true do
expect(commit.status).to eq("failed")
expect(commit.builds.any?).to be false
end
+
+ context 'when there are no jobs for this pipeline' do
+ before do
+ config = YAML.dump({ test: { deploy: 'ls', only: ['feature'] } })
+ stub_ci_commit_yaml_file(config)
+ end
+
+ it 'does not create a new pipeline' do
+ result = service.execute(project, user,
+ ref: 'refs/heads/master',
+ before: '00000000',
+ after: '31das312',
+ commits: [{ message: 'some msg'}])
+
+ expect(result).to be false
+ expect(Ci::Build.all).to be_empty
+ end
+ end
end
end