summaryrefslogtreecommitdiff
path: root/spec/models/application_setting_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 21:06:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 21:06:42 +0000
commitd5e0416021aa6de53b89f9d415f368226d9326e5 (patch)
tree9a3e3bd6d1aac10cfde7f0079f784a489491a48b /spec/models/application_setting_spec.rb
parent24fe7aa2aa199b2aace0cfec26d744f51d7e2167 (diff)
downloadgitlab-ce-d5e0416021aa6de53b89f9d415f368226d9326e5.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.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb
index 7bef3d30064..d16e83bb5df 100644
--- a/spec/models/application_setting_spec.rb
+++ b/spec/models/application_setting_spec.rb
@@ -64,6 +64,36 @@ describe ApplicationSetting do
it { is_expected.not_to allow_value('three').for(:push_event_activities_limit) }
it { is_expected.not_to allow_value(nil).for(:push_event_activities_limit) }
+ context 'when snowplow is enabled' do
+ before do
+ setting.snowplow_enabled = true
+ end
+
+ it { is_expected.not_to allow_value(nil).for(:snowplow_collector_hostname) }
+ it { is_expected.to allow_value("snowplow.gitlab.com").for(:snowplow_collector_hostname) }
+ it { is_expected.not_to allow_value('/example').for(:snowplow_collector_hostname) }
+ end
+
+ context 'when snowplow is not enabled' do
+ it { is_expected.to allow_value(nil).for(:snowplow_collector_hostname) }
+ end
+
+ context 'when pendo is enabled' do
+ before do
+ setting.pendo_enabled = true
+ end
+
+ it { is_expected.not_to allow_value(nil).for(:pendo_url) }
+ it { is_expected.to allow_value(http).for(:pendo_url) }
+ it { is_expected.to allow_value(https).for(:pendo_url) }
+ it { is_expected.not_to allow_value(ftp).for(:pendo_url) }
+ it { is_expected.not_to allow_value('http://127.0.0.1').for(:pendo_url) }
+ end
+
+ context 'when pendo is not enabled' do
+ it { is_expected.to allow_value(nil).for(:pendo_url) }
+ end
+
context "when user accepted let's encrypt terms of service" do
before do
setting.update(lets_encrypt_terms_of_service_accepted: true)