diff options
Diffstat (limited to 'spec/requests/api/graphql/mutations/alert_management')
-rw-r--r-- | spec/requests/api/graphql/mutations/alert_management/prometheus_integration/create_spec.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/requests/api/graphql/mutations/alert_management/prometheus_integration/create_spec.rb b/spec/requests/api/graphql/mutations/alert_management/prometheus_integration/create_spec.rb index 3dee7f50af3..ec94760e3f0 100644 --- a/spec/requests/api/graphql/mutations/alert_management/prometheus_integration/create_spec.rb +++ b/spec/requests/api/graphql/mutations/alert_management/prometheus_integration/create_spec.rb @@ -8,11 +8,13 @@ RSpec.describe 'Creating a new Prometheus Integration', feature_category: :incid let_it_be(:current_user) { create(:user) } let_it_be(:project) { create(:project) } + let(:api_url) { 'https://prometheus-url.com' } + let(:variables) do { project_path: project.full_path, active: false, - api_url: 'https://prometheus-url.com' + api_url: api_url } end @@ -56,7 +58,20 @@ RSpec.describe 'Creating a new Prometheus Integration', feature_category: :incid expect(integration_response['apiUrl']).to eq(new_integration.api_url) end - [:project_path, :active, :api_url].each do |argument| + context 'without api url' do + let(:api_url) { nil } + + it 'creates a new integration' do + post_graphql_mutation(mutation, current_user: current_user) + + integration_response = mutation_response['integration'] + + expect(response).to have_gitlab_http_status(:success) + expect(integration_response['apiUrl']).to be_nil + end + end + + [:project_path, :active].each do |argument| context "without required argument #{argument}" do before do variables.delete(argument) |