diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-02 13:38:30 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-06-03 11:34:36 +0200 |
commit | 1bcb61dd2076995b5fed786133f94def1fd637a5 (patch) | |
tree | ee594c831d1e1ec2b41473b08b081f5996d4f2da /spec | |
parent | af2f56f8f742e00ddb298fadea763fd0fe7054f0 (diff) | |
download | gitlab-ce-1bcb61dd2076995b5fed786133f94def1fd637a5.tar.gz |
Add specs covering case when there are no builds
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/create_commit_builds_service_spec.rb | 18 |
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 |