Commit c938349f authored by Sean Arnold's avatar Sean Arnold

Fix specs and syntax

- Add changlog
parent 7e70ed4c
...@@ -81,7 +81,7 @@ class AlertsService < Service ...@@ -81,7 +81,7 @@ class AlertsService < Service
end end
def update_http_integration def update_http_integration
return unless type == 'AlertsService' return unless project_id && type == 'AlertsService'
AlertManagement::SyncAlertServiceDataService # rubocop: disable CodeReuse/ServiceClass AlertManagement::SyncAlertServiceDataService # rubocop: disable CodeReuse/ServiceClass
.new(self) .new(self)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
module AlertManagement module AlertManagement
class SyncAlertServiceDataService class SyncAlertServiceDataService
# @param alert_service [AlertsService] # @param alert_service [AlertsService]
def initialize(alert_service) def initialize(alert_service)
@alert_service = alert_service @alert_service = alert_service
...@@ -23,9 +22,9 @@ module AlertManagement ...@@ -23,9 +22,9 @@ module AlertManagement
def find_http_integration def find_http_integration
AlertManagement::HttpIntegrationsFinder.new( AlertManagement::HttpIntegrationsFinder.new(
alert_service.project, alert_service.project,
endpoint_identifier: ::AlertManagement::HttpIntegration::LEGACY_IDENTIFIER endpoint_identifier: ::AlertManagement::HttpIntegration::LEGACY_IDENTIFIER
) )
.execute .execute
.first .first
end end
......
---
title: Migrate Alert Service to HTTP Integrations model
merge_request: 46188
author:
type: added
...@@ -25,7 +25,7 @@ RSpec.describe AlertManagement::SyncAlertServiceDataService do ...@@ -25,7 +25,7 @@ RSpec.describe AlertManagement::SyncAlertServiceDataService do
end end
context 'existing other http integration' do context 'existing other http integration' do
let_it_be(:integration) { create(:alert_management_http_integration, project: alerts_service.project) } let_it_be(:integration) { create(:alert_management_http_integration, project: alerts_service.project) }
it 'does not update the integration' do it 'does not update the integration' do
expect { subject } expect { subject }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment