diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /spec/helpers/ci | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/helpers/ci')
-rw-r--r-- | spec/helpers/ci/runners_helper_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/ci/runners_helper_spec.rb b/spec/helpers/ci/runners_helper_spec.rb index a006933a2a5..38caae91ef2 100644 --- a/spec/helpers/ci/runners_helper_spec.rb +++ b/spec/helpers/ci/runners_helper_spec.rb @@ -53,4 +53,25 @@ RSpec.describe Ci::RunnersHelper do end end end + + describe '#group_shared_runners_settings_data' do + let(:group) { create(:group, parent: parent, shared_runners_enabled: false) } + let(:parent) { create(:group) } + + it 'returns group data for top level group' do + data = group_shared_runners_settings_data(parent) + + expect(data[:update_path]).to eq("/api/v4/groups/#{parent.id}") + expect(data[:shared_runners_availability]).to eq('enabled') + expect(data[:parent_shared_runners_availability]).to eq(nil) + end + + it 'returns group data for child group' do + data = group_shared_runners_settings_data(group) + + expect(data[:update_path]).to eq("/api/v4/groups/#{group.id}") + expect(data[:shared_runners_availability]).to eq('disabled_and_unoverridable') + expect(data[:parent_shared_runners_availability]).to eq('enabled') + end + end end |