diff options
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 |