diff options
Diffstat (limited to 'spec/helpers/operations_helper_spec.rb')
-rw-r--r-- | spec/helpers/operations_helper_spec.rb | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/spec/helpers/operations_helper_spec.rb b/spec/helpers/operations_helper_spec.rb index 09f9bba8f9e..801d5de79b1 100644 --- a/spec/helpers/operations_helper_spec.rb +++ b/spec/helpers/operations_helper_spec.rb @@ -21,20 +21,15 @@ RSpec.describe OperationsHelper do end context 'initial service configuration' do - let_it_be(:alerts_service) { AlertsService.new(project: project) } let_it_be(:prometheus_service) { PrometheusService.new(project: project) } before do - allow(project).to receive(:find_or_initialize_service).with('alerts').and_return(alerts_service) + allow(project).to receive(:find_or_initialize_service).and_call_original allow(project).to receive(:find_or_initialize_service).with('prometheus').and_return(prometheus_service) end it 'returns the correct values' do expect(subject).to eq( - 'activated' => 'false', - 'url' => alerts_service.url, - 'authorization_key' => nil, - 'form_path' => project_service_path(project, alerts_service), 'alerts_setup_url' => help_page_path('operations/incident_management/alert_integrations.md', anchor: 'generic-http-endpoint'), 'alerts_usage_url' => project_alert_management_index_path(project), 'prometheus_form_path' => project_service_path(project, prometheus_service), @@ -104,33 +99,6 @@ RSpec.describe OperationsHelper do end end end - - context 'with generic alerts service configured' do - let_it_be(:alerts_service) { create(:alerts_service, project: project) } - - context 'with generic alerts enabled' do - it 'returns the correct values' do - expect(subject).to include( - 'activated' => 'true', - 'authorization_key' => alerts_service.token, - 'url' => alerts_service.url - ) - end - end - - context 'with generic alerts disabled' do - before do - alerts_service.update!(active: false) - end - - it 'returns the correct values' do - expect(subject).to include( - 'activated' => 'false', - 'authorization_key' => alerts_service.token - ) - end - end - end end describe '#operations_settings_data' do |