diff options
author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-12-13 10:39:55 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-12-13 10:39:55 +0000 |
commit | 0165cfaa078a50f52c9f24e1c468b77b509c89f3 (patch) | |
tree | 0d1ab70049703c76440281aba201f3a6d2d81d52 /spec/services/ci/create_pipeline_service_spec.rb | |
parent | 6b68d82fbf2da3f73d411e7a6fbda16cd3b94604 (diff) | |
download | gitlab-ce-0165cfaa078a50f52c9f24e1c468b77b509c89f3.tar.gz |
Re-define default only except policy
Diffstat (limited to 'spec/services/ci/create_pipeline_service_spec.rb')
-rw-r--r-- | spec/services/ci/create_pipeline_service_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb index 8b8021ecbc8..ffa47d527f7 100644 --- a/spec/services/ci/create_pipeline_service_spec.rb +++ b/spec/services/ci/create_pipeline_service_spec.rb @@ -840,6 +840,37 @@ describe Ci::CreatePipelineService do end end + context "when config uses variables for only keyword" do + let(:config) do + { + build: { + stage: 'build', + script: 'echo', + only: { + variables: %w($CI) + } + } + } + end + + context 'when merge request is specified' do + let(:merge_request) do + create(:merge_request, + source_project: project, + source_branch: ref_name, + target_project: project, + target_branch: 'master') + end + + it 'does not create a merge request pipeline' do + expect(pipeline).not_to be_persisted + + expect(pipeline.errors[:base]) + .to eq(['No stages / jobs for this pipeline.']) + end + end + end + context "when config has 'except: [tags]'" do let(:config) do { |