diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-19 03:07:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-19 03:07:58 +0300 |
commit | 41456efd551f45f569a8c9e70734c88efbbbf0ec (patch) | |
tree | 4ac9d0f1773a8786ba263e88e3d472afcff3d3c1 /spec/services/projects/prometheus/alerts/notify_service_spec.rb | |
parent | fe289cff8b1b94020d22f7b3ff1c385a05086b9e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/projects/prometheus/alerts/notify_service_spec.rb')
-rw-r--r-- | spec/services/projects/prometheus/alerts/notify_service_spec.rb | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/spec/services/projects/prometheus/alerts/notify_service_spec.rb b/spec/services/projects/prometheus/alerts/notify_service_spec.rb index bfa784cd212..009543f9016 100644 --- a/spec/services/projects/prometheus/alerts/notify_service_spec.rb +++ b/spec/services/projects/prometheus/alerts/notify_service_spec.rb @@ -225,37 +225,18 @@ describe Projects::Prometheus::Alerts::NotifyService do create(:project_alerting_setting, project: project, token: token) end - context 'when alert_management_minimal feature enabled' do - before do - stub_feature_flags(alert_management_minimal: true) - end - - context 'with multiple firing alerts and resolving alerts' do - let(:payload_raw) do - payload_for(firing: [alert_firing, alert_firing], resolved: [alert_resolved]) - end - - it 'processes Prometheus alerts' do - expect(AlertManagement::ProcessPrometheusAlertService) - .to receive(:new) - .with(project, nil, kind_of(Hash)) - .exactly(3).times - .and_return(process_service) - expect(process_service).to receive(:execute).exactly(3).times - - subject - end - end - end - - context 'when alert_management_minimal feature disabled' do - before do - stub_feature_flags(alert_management_minimal: false) + context 'with multiple firing alerts and resolving alerts' do + let(:payload_raw) do + payload_for(firing: [alert_firing, alert_firing], resolved: [alert_resolved]) end - it 'does not process Prometheus alerts' do + it 'processes Prometheus alerts' do expect(AlertManagement::ProcessPrometheusAlertService) - .not_to receive(:new) + .to receive(:new) + .with(project, nil, kind_of(Hash)) + .exactly(3).times + .and_return(process_service) + expect(process_service).to receive(:execute).exactly(3).times subject end |