diff options
Diffstat (limited to 'spec/support/shared_examples/graphql/mutations/http_integrations_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/graphql/mutations/http_integrations_shared_examples.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/shared_examples/graphql/mutations/http_integrations_shared_examples.rb b/spec/support/shared_examples/graphql/mutations/http_integrations_shared_examples.rb new file mode 100644 index 00000000000..0338eb43f8d --- /dev/null +++ b/spec/support/shared_examples/graphql/mutations/http_integrations_shared_examples.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'creating a new HTTP integration' do + it 'creates a new integration' do + post_graphql_mutation(mutation, current_user: current_user) + + new_integration = ::AlertManagement::HttpIntegration.last! + integration_response = mutation_response['integration'] + + expect(response).to have_gitlab_http_status(:success) + expect(integration_response['id']).to eq(GitlabSchema.id_from_object(new_integration).to_s) + expect(integration_response['type']).to eq('HTTP') + expect(integration_response['name']).to eq(new_integration.name) + expect(integration_response['active']).to eq(new_integration.active) + expect(integration_response['token']).to eq(new_integration.token) + expect(integration_response['url']).to eq(new_integration.url) + expect(integration_response['apiUrl']).to eq(nil) + end +end |