summaryrefslogtreecommitdiff
path: root/spec/helpers/ci/runners_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/helpers/ci/runners_helper_spec.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/helpers/ci/runners_helper_spec.rb')
-rw-r--r--spec/helpers/ci/runners_helper_spec.rb21
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