Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/integrations_spec.rb')
-rw-r--r--spec/requests/api/integrations_spec.rb25
1 files changed, 5 insertions, 20 deletions
diff --git a/spec/requests/api/integrations_spec.rb b/spec/requests/api/integrations_spec.rb
index 4922a07cd6c..d8ac9d5abf7 100644
--- a/spec/requests/api/integrations_spec.rb
+++ b/spec/requests/api/integrations_spec.rb
@@ -63,25 +63,8 @@ RSpec.describe API::Integrations, feature_category: :integrations do
describe "PUT /projects/:id/#{endpoint}/#{integration.dasherize}" do
include_context 'with integration'
- # NOTE: Some attributes are not supported for PUT requests, even though they probably should be.
- # We can fix these manually, or with a generic approach like https://gitlab.com/gitlab-org/gitlab/-/issues/348208
- let(:missing_attributes) do
- {
- datadog: %i[archive_trace_events],
- hangouts_chat: %i[notify_only_broken_pipelines],
- jira: %i[issues_enabled project_key jira_issue_regex jira_issue_prefix vulnerabilities_enabled vulnerabilities_issuetype],
- mattermost: %i[labels_to_be_notified],
- mock_ci: %i[enable_ssl_verification],
- prometheus: %i[manual_configuration],
- pumble: %i[branches_to_be_notified notify_only_broken_pipelines],
- slack: %i[labels_to_be_notified],
- unify_circuit: %i[branches_to_be_notified notify_only_broken_pipelines],
- webex_teams: %i[branches_to_be_notified notify_only_broken_pipelines]
- }
- end
-
it "updates #{integration} settings and returns the correct fields" do
- supported_attrs = integration_attrs.without(missing_attributes.fetch(integration.to_sym, []))
+ supported_attrs = attributes_for(integration_factory).without(:active, :type)
put api("/projects/#{project.id}/#{endpoint}/#{dashed_integration}", user), params: supported_attrs
@@ -112,6 +95,8 @@ RSpec.describe API::Integrations, feature_category: :integrations do
end
end
+ integration_attrs = attributes_for(integration_factory).without(:active, :type)
+
if required_attributes.empty?
expected_code = :ok
else
@@ -129,7 +114,7 @@ RSpec.describe API::Integrations, feature_category: :integrations do
include_context 'with integration'
before do
- initialize_integration(integration)
+ create(integration_factory, project: project)
end
it "deletes #{integration}" do
@@ -144,7 +129,7 @@ RSpec.describe API::Integrations, feature_category: :integrations do
describe "GET /projects/:id/#{endpoint}/#{integration.dasherize}" do
include_context 'with integration'
- let!(:initialized_integration) { initialize_integration(integration, active: true) }
+ let!(:initialized_integration) { create(integration_factory, project: project) }
let_it_be(:project2) do
create(:project, creator_id: user.id, namespace: user.namespace)