summaryrefslogtreecommitdiff
path: root/spec/helpers/application_settings_helper_spec.rb
diff options
context:
space:
mode:
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? }