summaryrefslogtreecommitdiff
path: root/spec/models/application_setting_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-22 09:08:09 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-22 09:08:09 +0000
commit4a3ba3e5f261eb09e6b2b4fd44373e7a1c454a72 (patch)
tree1a94467252ebcc5575c7de6a3590360ce05b9967 /spec/models/application_setting_spec.rb
parent707c0eca50cf9a5290806ce637be30f4c7288def (diff)
downloadgitlab-ce-4a3ba3e5f261eb09e6b2b4fd44373e7a1c454a72.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/application_setting_spec.rb')
-rw-r--r--spec/models/application_setting_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb
index 64308af38f9..8d963d41fce 100644
--- a/spec/models/application_setting_spec.rb
+++ b/spec/models/application_setting_spec.rb
@@ -152,6 +152,30 @@ describe ApplicationSetting do
end
end
+ describe 'spam_check_endpoint' do
+ context 'when spam_check_endpoint is enabled' do
+ before do
+ setting.spam_check_endpoint_enabled = true
+ end
+
+ it { is_expected.to allow_value('https://example.org/spam_check').for(:spam_check_endpoint_url) }
+ it { is_expected.not_to allow_value('nonsense').for(:spam_check_endpoint_url) }
+ it { is_expected.not_to allow_value(nil).for(:spam_check_endpoint_url) }
+ it { is_expected.not_to allow_value('').for(:spam_check_endpoint_url) }
+ end
+
+ context 'when spam_check_endpoint is NOT enabled' do
+ before do
+ setting.spam_check_endpoint_enabled = false
+ end
+
+ it { is_expected.to allow_value('https://example.org/spam_check').for(:spam_check_endpoint_url) }
+ it { is_expected.not_to allow_value('nonsense').for(:spam_check_endpoint_url) }
+ it { is_expected.to allow_value(nil).for(:spam_check_endpoint_url) }
+ it { is_expected.to allow_value('').for(:spam_check_endpoint_url) }
+ end
+ end
+
context 'when snowplow is enabled' do
before do
setting.snowplow_enabled = true