diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-12-08 10:50:10 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-12-08 10:50:10 +0100 |
commit | b30e0e0691716c2ef0b858b81dd5cef8d4728c59 (patch) | |
tree | 658af97734ba537da94ed1156f108248cfaad952 /spec/services | |
parent | fe62860e05ca6e3ef7125fe92fdf52cd6f7b63df (diff) | |
download | gitlab-ce-b30e0e0691716c2ef0b858b81dd5cef8d4728c59.tar.gz |
Fix invalid pipeline build chain tag evaluation
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index b0de8d447a2..be4abf11cf4 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -518,5 +518,25 @@ describe Ci::CreatePipelineService do end end end + + context 'when pipelie is running for a tag' do + before do + allow_any_instance_of(Repository) + .to receive(:tag_exists?).and_return(false) + allow_any_instance_of(Repository) + .to receive(:tag_exists?).with('refs/tags/mytag').and_return(true) + + config = YAML.dump(test: { script: 'test', only: ['branches'] }, + deploy: { script: 'deploy', only: ['tags'] }) + + stub_ci_pipeline_yaml_file(config) + end + + it 'creates a tagged pipeline' do + pipeline = execute_service(ref: 'mytag') + + expect(pipeline.tag?).to be true + end + end end end |