Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-27 21:08:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-27 21:08:10 +0300
commit034c9310c8f946cf82651e63f73bed0a599d345b (patch)
treed4002ea7a90c614c723a4feceaba218872f7820d
parentd9953dadb4f0170a32fbb3204564f2f96396656e (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--spec/lib/gitlab/ci/config/entry/needs_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/config/entry/needs_spec.rb b/spec/lib/gitlab/ci/config/entry/needs_spec.rb
index d1a8a74ac06..61bb3e912ba 100644
--- a/spec/lib/gitlab/ci/config/entry/needs_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/needs_spec.rb
@@ -52,6 +52,27 @@ RSpec.describe ::Gitlab::Ci::Config::Entry::Needs, feature_category: :pipeline_c
end
end
+ context 'when config has disallowed keys' do
+ let(:config) { ['some_value'] }
+
+ before do
+ needs.metadata[:allowed_needs] = %i[cross_dependency]
+ needs.compose!
+ end
+
+ describe '#valid?' do
+ it 'returns invalid' do
+ expect(needs.valid?).to be_falsey
+ end
+ end
+
+ describe '#errors' do
+ it 'returns invalid types error' do
+ expect(needs.errors).to include('needs config uses invalid types: job')
+ end
+ end
+ end
+
context 'when wrong needs type is used' do
let(:config) { [{ job: 'job_name', artifacts: true, some: :key }] }