diff options
Diffstat (limited to 'spec/requests/api/graphql/project/alert_management/integrations_spec.rb')
-rw-r--r-- | spec/requests/api/graphql/project/alert_management/integrations_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/requests/api/graphql/project/alert_management/integrations_spec.rb b/spec/requests/api/graphql/project/alert_management/integrations_spec.rb index 0e029aee9e8..1793d4961eb 100644 --- a/spec/requests/api/graphql/project/alert_management/integrations_spec.rb +++ b/spec/requests/api/graphql/project/alert_management/integrations_spec.rb @@ -7,7 +7,7 @@ RSpec.describe 'getting Alert Management Integrations' do let_it_be(:project) { create(:project, :repository) } let_it_be(:current_user) { create(:user) } - let_it_be(:prometheus_service) { create(:prometheus_service, project: project) } + let_it_be(:prometheus_integration) { create(:prometheus_integration, project: project) } let_it_be(:project_alerting_setting) { create(:project_alerting_setting, project: project) } let_it_be(:active_http_integration) { create(:alert_management_http_integration, project: project) } let_it_be(:inactive_http_integration) { create(:alert_management_http_integration, :inactive, project: project) } @@ -53,15 +53,15 @@ RSpec.describe 'getting Alert Management Integrations' do end context 'when no extra params given' do - let(:http_integration) { integrations.first } - let(:prometheus_integration) { integrations.second } + let(:http_integration_response) { integrations.first } + let(:prometheus_integration_response) { integrations.second } it_behaves_like 'a working graphql query' it { expect(integrations.size).to eq(2) } it 'returns the correct properties of the integrations' do - expect(http_integration).to include( + expect(http_integration_response).to include( 'id' => global_id_of(active_http_integration), 'type' => 'HTTP', 'name' => active_http_integration.name, @@ -71,14 +71,14 @@ RSpec.describe 'getting Alert Management Integrations' do 'apiUrl' => nil ) - expect(prometheus_integration).to include( - 'id' => global_id_of(prometheus_service), + expect(prometheus_integration_response).to include( + 'id' => global_id_of(prometheus_integration), 'type' => 'PROMETHEUS', 'name' => 'Prometheus', - 'active' => prometheus_service.manual_configuration?, + 'active' => prometheus_integration.manual_configuration?, 'token' => project_alerting_setting.token, 'url' => "http://localhost/#{project.full_path}/prometheus/alerts/notify.json", - 'apiUrl' => prometheus_service.api_url + 'apiUrl' => prometheus_integration.api_url ) end end @@ -104,7 +104,7 @@ RSpec.describe 'getting Alert Management Integrations' do end context 'when Prometheus Integration ID is given' do - let(:params) { { id: global_id_of(prometheus_service) } } + let(:params) { { id: global_id_of(prometheus_integration) } } it_behaves_like 'a working graphql query' @@ -112,13 +112,13 @@ RSpec.describe 'getting Alert Management Integrations' do it 'returns the correct properties of the Prometheus Integration' do expect(integrations.first).to include( - 'id' => global_id_of(prometheus_service), + 'id' => global_id_of(prometheus_integration), 'type' => 'PROMETHEUS', 'name' => 'Prometheus', - 'active' => prometheus_service.manual_configuration?, + 'active' => prometheus_integration.manual_configuration?, 'token' => project_alerting_setting.token, 'url' => "http://localhost/#{project.full_path}/prometheus/alerts/notify.json", - 'apiUrl' => prometheus_service.api_url + 'apiUrl' => prometheus_integration.api_url ) end end |