Commit 0209de5d authored by Arturo Herrero's avatar Arturo Herrero

Merge branch...

Merge branch '296776-issues-created-from-vulnerabilities-set-to-confidential-by-default' into 'master'

Issues created from Vulnerabilities set to Confidential by default

See merge request gitlab-org/gitlab!52127
parents 981ad651 3cb092a7
......@@ -105,7 +105,7 @@ class Projects::IssuesController < Projects::ApplicationController
build_params = issue_create_params.merge(
merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of],
discussion_to_resolve: params[:discussion_to_resolve],
confidential: !!Gitlab::Utils.to_boolean(params[:issue][:confidential])
confidential: !!Gitlab::Utils.to_boolean(issue_create_params[:confidential])
)
service = ::Issues::BuildService.new(project, current_user, build_params)
......
---
title: Issues created from Vulnerabilities set to Confidential by default
merge_request: 52127
author:
type: changed
......@@ -69,11 +69,19 @@ RSpec.describe Projects::IssuesController do
let(:vulnerability) { create(:vulnerability, project: project, findings: [finding]) }
let(:vulnerability_field) { "<input type=\"hidden\" name=\"vulnerability_id\" id=\"vulnerability_id\" value=\"#{vulnerability.id}\" />" }
subject { get :new, params: { namespace_id: project.namespace, project_id: project, vulnerability_id: vulnerability.id } }
it 'sets the vulnerability_id' do
get :new, params: { namespace_id: project.namespace, project_id: project, vulnerability_id: vulnerability.id }
subject
expect(response.body).to include(vulnerability_field)
end
it 'sets the confidential flag to true by default' do
subject
expect(assigns(:issue).confidential).to eq(true)
end
end
end
......
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