diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-31 00:05:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-31 00:05:14 +0000 |
commit | ae92150461ad4cffcf85a4dc6313bc403e596391 (patch) | |
tree | 1a7eca0fcd474f05f2fabee23f94b762a54d9d9e /spec/models | |
parent | 386b6dbcda5bb479ff0a6038d5dcf188bcd878b8 (diff) | |
download | gitlab-ce-ae92150461ad4cffcf85a4dc6313bc403e596391.tar.gz |
Add latest changes from gitlab-org/security/gitlab@14-9-stable-ee
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/runner_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 0620bb1ffc5..42187c3ef99 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -41,15 +41,25 @@ RSpec.describe Ci::Runner do context 'when runner is not allowed to pick untagged jobs' do context 'when runner does not have tags' do + let(:runner) { build(:ci_runner, tag_list: [], run_untagged: false) } + + it 'is not valid' do + expect(runner).to be_invalid + end + end + + context 'when runner has too many tags' do + let(:runner) { build(:ci_runner, tag_list: (1..::Ci::Runner::TAG_LIST_MAX_LENGTH + 1).map { |i| "tag#{i}" }, run_untagged: false) } + it 'is not valid' do - runner = build(:ci_runner, tag_list: [], run_untagged: false) expect(runner).to be_invalid end end context 'when runner has tags' do + let(:runner) { build(:ci_runner, tag_list: ['tag'], run_untagged: false) } + it 'is valid' do - runner = build(:ci_runner, tag_list: ['tag'], run_untagged: false) expect(runner).to be_valid end end |