summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorrpereira2 <rpereira@gitlab.com>2019-08-26 12:41:25 +0530
committerrpereira2 <rpereira@gitlab.com>2019-08-26 13:00:10 +0530
commitb99cf2024d1b518d876bc4f1f4aac8549b4dd993 (patch)
tree25c2ccd04f3d75c4afca104b06bd88c3d2d952e3 /spec
parent8112fb37544557b3f94c0a558175d5da99ef9829 (diff)
downloadgitlab-ce-b99cf2024d1b518d876bc4f1f4aac8549b4dd993.tar.gz
Add nil check for Gitlab.config.prometheus13806-fix
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
index 9bd0d800086..b25f0f6b887 100644
--- a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
+++ b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb
@@ -197,6 +197,17 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do
end
end
+ context 'when prometheus setting is nil' do
+ before do
+ stub_config(prometheus: nil)
+ end
+
+ it 'does not fail' do
+ expect(result).to include(status: :success)
+ expect(project.prometheus_service).to be_nil
+ end
+ end
+
context 'when prometheus setting is disabled in gitlab.yml' do
let(:prometheus_settings) do
{