summaryrefslogtreecommitdiff
path: root/spec/models/application_setting_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /spec/models/application_setting_spec.rb
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r--spec/models/application_setting_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb
index 4e72d558b52..80471a09bbd 100644
--- a/spec/models/application_setting_spec.rb
+++ b/spec/models/application_setting_spec.rb
@@ -134,6 +134,14 @@ RSpec.describe ApplicationSetting do
it { is_expected.to allow_value('disabled').for(:whats_new_variant) }
it { is_expected.not_to allow_value(nil).for(:whats_new_variant) }
+ it { is_expected.not_to allow_value(['']).for(:valid_runner_registrars) }
+ it { is_expected.not_to allow_value(['OBVIOUSLY_WRONG']).for(:valid_runner_registrars) }
+ it { is_expected.not_to allow_value(%w(project project)).for(:valid_runner_registrars) }
+ it { is_expected.not_to allow_value([nil]).for(:valid_runner_registrars) }
+ it { is_expected.not_to allow_value(nil).for(:valid_runner_registrars) }
+ it { is_expected.to allow_value([]).for(:valid_runner_registrars) }
+ it { is_expected.to allow_value(%w(project group)).for(:valid_runner_registrars) }
+
context 'help_page_documentation_base_url validations' do
it { is_expected.to allow_value(nil).for(:help_page_documentation_base_url) }
it { is_expected.to allow_value('https://docs.gitlab.com').for(:help_page_documentation_base_url) }
@@ -250,6 +258,19 @@ RSpec.describe ApplicationSetting do
it { is_expected.to allow_value(nil).for(:snowplow_collector_hostname) }
end
+ context 'when mailgun_events_enabled is enabled' do
+ before do
+ setting.mailgun_events_enabled = true
+ end
+
+ it { is_expected.to validate_presence_of(:mailgun_signing_key) }
+ it { is_expected.to validate_length_of(:mailgun_signing_key).is_at_most(255) }
+ end
+
+ context 'when mailgun_events_enabled is not enabled' do
+ it { is_expected.not_to validate_presence_of(:mailgun_signing_key) }
+ end
+
context "when user accepted let's encrypt terms of service" do
before do
expect do