diff options
author | Nick Thomas <nick@gitlab.com> | 2018-04-11 00:55:02 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-04-11 00:55:02 +0100 |
commit | 3f73bdd837f9803b75eca484a0a0615db6c58c80 (patch) | |
tree | 0bd2c99d9198bfa22e7a29f375131f940033da7b /spec/models/ci/pipeline_spec.rb | |
parent | b594ab949d1a2ceb9d949ff2641679fbdf273452 (diff) | |
parent | 37a5632483b67ddcfa4c535cc911319b25f01fb5 (diff) | |
download | gitlab-ce-xterm-npm.tar.gz |
Merge branch 'master' into xterm-npmxterm-npm
Diffstat (limited to 'spec/models/ci/pipeline_spec.rb')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 92f00cfbc19..dd94515b0a4 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -346,6 +346,20 @@ describe Ci::Pipeline, :mailer do end end end + + context 'when variables policy is specified' do + let(:config) do + { unit: { script: 'minitest', only: { variables: ['$CI_PIPELINE_SOURCE'] } }, + feature: { script: 'spinach', only: { variables: ['$UNDEFINED'] } } } + end + + it 'returns stage seeds only when variables expression is truthy' do + seeds = pipeline.stage_seeds + + expect(seeds.size).to eq 1 + expect(seeds.dig(0, 0, :name)).to eq 'unit' + end + end end describe '#seeds_size' do |