diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 00:08:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 00:08:11 +0000 |
commit | 93dcf45d441bc884b167f4338380c8c888e9b86f (patch) | |
tree | f55e8c1d39013380d1ff7d2a4e3cca537a35192a /spec/features | |
parent | 0e68afab211a172b862a7acc774e1eda5da8e471 (diff) | |
download | gitlab-ce-93dcf45d441bc884b167f4338380c8c888e9b86f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/services/prometheus_external_alerts_spec.rb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/spec/features/projects/services/prometheus_external_alerts_spec.rb b/spec/features/projects/services/prometheus_external_alerts_spec.rb new file mode 100644 index 00000000000..e33b2d9a75e --- /dev/null +++ b/spec/features/projects/services/prometheus_external_alerts_spec.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Prometheus external alerts', :js do + let(:project) { create(:project) } + let(:user) { create(:user) } + + let(:alerts_section_selector) { '.js-prometheus-alerts' } + let(:alerts_section) { page.find(alerts_section_selector) } + + before do + sign_in(user) + project.add_maintainer(user) + + visit_edit_service + end + + context 'with manual configuration' do + before do + create(:prometheus_service, project: project, api_url: 'http://prometheus.example.com', manual_configuration: '1', active: true) + end + + it 'shows the Alerts section' do + visit_edit_service + + expect(alerts_section).to have_content('Alerts') + expect(alerts_section).to have_content('Receive alerts from manually configured Prometheus servers.') + expect(alerts_section).to have_content('URL') + expect(alerts_section).to have_content('Authorization key') + end + end + + context 'with no configuration' do + it 'does not show the Alerts section' do + wait_for_requests + + expect(page).not_to have_css(alerts_section_selector) + end + end + + private + + def visit_edit_service + visit(project_settings_integrations_path(project)) + click_link('Prometheus') + end +end |