Commit 684e1d15 authored by Jonathan Schafer's avatar Jonathan Schafer Committed by Dmytro Zaporozhets (DZ)

Do not overwrite fields that are populated

parent 15b9bc05
......@@ -66,10 +66,12 @@ module EE
end
def vulnerability_issue_build_parameters
issue = params[:issue]
{
title: _("Investigate vulnerability: %{title}") % { title: vulnerability.title },
description: render_vulnerability_description,
confidential: true
title: issue.fetch(:title, _("Investigate vulnerability: %{title}") % { title: vulnerability.title }),
description: issue.fetch(:description, render_vulnerability_description),
confidential: issue.fetch(:confidential, true)
}
end
......
---
title: Fixed bug that overwrote issue description changes from vulnerabilities
merge_request: 52376
author:
type: fixed
......@@ -104,6 +104,15 @@ RSpec.describe Projects::IssuesController do
expect(project.issues.last.vulnerability_links.first.vulnerability).to eq(vulnerability)
end
it 'overwrites the default fields' do
send_request
issue = project.issues.last
expect(issue.title).to eq('Title')
expect(issue.description).to eq('Description')
expect(issue.confidential).to be false
end
context 'when vulnerability already has a linked issue' do
render_views
......@@ -123,7 +132,7 @@ RSpec.describe Projects::IssuesController do
post :create, params: {
namespace_id: project.namespace.to_param,
project_id: project,
issue: { title: 'Title', description: 'Description' },
issue: { title: 'Title', description: 'Description', confidential: 'false' },
vulnerability_id: vulnerability.id
}
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