summaryrefslogtreecommitdiff
path: root/spec/helpers/application_settings_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-06-21 21:08:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-06-21 21:08:33 +0000
commitee04416cd44b73dbb5588952cf3989c167104569 (patch)
tree24bb8d3d822cef6f67a0ae8b35ad5fd1950a78be /spec/helpers/application_settings_helper_spec.rb
parent6f03d13ddbc2ac2f18517ce2c8b838f89a774c7c (diff)
downloadgitlab-ce-ee04416cd44b73dbb5588952cf3989c167104569.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/application_settings_helper_spec.rb')
-rw-r--r--spec/helpers/application_settings_helper_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/application_settings_helper_spec.rb b/spec/helpers/application_settings_helper_spec.rb
index 4c62b3e12c1..90bfb2e72e6 100644
--- a/spec/helpers/application_settings_helper_spec.rb
+++ b/spec/helpers/application_settings_helper_spec.rb
@@ -178,6 +178,26 @@ RSpec.describe ApplicationSettingsHelper do
end
end
+ describe '.valid_runner_registrars' do
+ subject { helper.valid_runner_registrars }
+
+ context 'when only admins are permitted to register runners' do
+ before do
+ stub_application_setting(valid_runner_registrars: [])
+ end
+
+ it { is_expected.to eq [] }
+ end
+
+ context 'when group and project users are permitted to register runners' do
+ before do
+ stub_application_setting(valid_runner_registrars: ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES)
+ end
+
+ it { is_expected.to eq ApplicationSetting::VALID_RUNNER_REGISTRAR_TYPES }
+ end
+ end
+
describe '.signup_enabled?' do
subject { helper.signup_enabled? }