Skip to content
Snippets Groups Projects
Commit 684e1d15 authored by Jonathan Schafer's avatar Jonathan Schafer Committed by Dmytro Zaporozhets (DZ)
Browse files

Do not overwrite fields that are populated

parent 15b9bc05
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -66,10 +66,12 @@ def vulnerability
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
 
Loading
Loading
---
title: Fixed bug that overwrote issue description changes from vulnerabilities
merge_request: 52376
author:
type: fixed
Loading
Loading
@@ -104,6 +104,15 @@ def perform(method, action, opts = {})
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
 
Loading
Loading
@@ -123,7 +132,7 @@ def send_request
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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment