diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/finders/ci | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/finders/ci')
-rw-r--r-- | spec/finders/ci/runners_finder_spec.rb | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/spec/finders/ci/runners_finder_spec.rb b/spec/finders/ci/runners_finder_spec.rb index 8d3c375385a..18eecd0f073 100644 --- a/spec/finders/ci/runners_finder_spec.rb +++ b/spec/finders/ci/runners_finder_spec.rb @@ -319,6 +319,17 @@ RSpec.describe Ci::RunnersFinder do end end + context 'with :all_available membership' do + let(:membership) { :all_available } + + it 'returns runners available to group' do + expect(subject).to match_array([runner_project_7, runner_project_6, runner_project_5, + runner_project_4, runner_project_3, runner_project_2, + runner_project_1, runner_sub_group_4, runner_sub_group_3, + runner_sub_group_2, runner_sub_group_1, runner_group, runner_instance]) + end + end + context 'with unknown membership' do let(:membership) { :unsupported } @@ -400,11 +411,31 @@ RSpec.describe Ci::RunnersFinder do with_them do before do - create(:group_member, user_permission, group: group, user: user) + create(:group_member, user_permission, group: sub_group_1, user: user) + end + + context 'with :sub_group_1 as target group' do + let(:target_group) { sub_group_1 } + + it 'returns no runners' do + is_expected.to be_empty + end end - it 'returns no runners' do - expect(subject).to be_empty + context 'with :group as target group' do + let(:target_group) { group } + + it 'returns no runners' do + is_expected.to be_empty + end + + context 'with :all_available membership' do + let(:membership) { :all_available } + + it 'returns no runners' do + expect(subject).to be_empty + end + end end end end |