diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-08 15:08:17 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-08 15:08:17 +0000 |
commit | 1ec1bec4ee7ef7cb2e6faa7af625950f6d7aa290 (patch) | |
tree | 515047b93cfb054156b99c612684eb9a4c45330d /spec/helpers/ci | |
parent | 2f5c5b1081fe544ecb9a71d8adf88e00f01f3732 (diff) | |
download | gitlab-ce-1ec1bec4ee7ef7cb2e6faa7af625950f6d7aa290.tar.gz |
Add latest changes from gitlab-org/gitlab@master
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 |