diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-30 14:59:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-30 14:59:16 +0300 |
commit | 8249158901ae0d88d3cf0f23084559c2ce8907a8 (patch) | |
tree | 9b9142fc85fb5a11fe988ae54e86521ea5fbd679 /spec | |
parent | e6572d41b847c839ce49bc022a8cd1b99216798b (diff) |
Add latest changes from gitlab-org/security/gitlab@15-6-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/ci/pipeline/chain/populate_metadata_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/lib/gitlab/ci/pipeline/chain/populate_metadata_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/populate_metadata_spec.rb index ce1ee2fcda0..35e1c48a942 100644 --- a/spec/lib/gitlab/ci/pipeline/chain/populate_metadata_spec.rb +++ b/spec/lib/gitlab/ci/pipeline/chain/populate_metadata_spec.rb @@ -89,6 +89,18 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::PopulateMetadata do expect(pipeline.pipeline_metadata).to be_nil end + + context 'with empty name after variable substitution' do + let(:config) do + { workflow: { name: '$VAR1' }, rspec: { script: 'rspec' } } + end + + it 'does not save empty name' do + run_chain + + expect(pipeline.pipeline_metadata).to be_nil + end + end end context 'with variables' do @@ -106,7 +118,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::PopulateMetadata do it 'substitutes variables' do run_chain - expect(pipeline.pipeline_metadata.name).to eq('Pipeline value value1 value2 ') + expect(pipeline.pipeline_metadata.name).to eq('Pipeline value value1 value2') end end |