Commit 8b7d819a authored by Jonathan Schafer's avatar Jonathan Schafer

Code cleanup from MR comments

parent 5973f75c
......@@ -30,25 +30,25 @@
%h3= _('Location')
%ul
%li
= _("File:")
= _('File:')
= vulnerability_file_link(@vulnerability)
- if location['class']
%li
= _("Class:")
= _('Class:')
= location['class']
- if location['method']
%li
= _("Method:")
= _('Method:')
%code= location['method']
- if finding.links.any?
%h3= _("Links")
%h3= _('Links')
%ul
- finding.links.each do |link|
%li= link_to link["url"], target: '_blank', rel: 'noopener noreferrer'
%li= link_to link['url'], target: '_blank', rel: 'noopener noreferrer'
- if finding.identifiers.any?
%h3= _("Identifiers")
%h3= _('Identifiers')
%ul
- finding.identifiers.each do |identifier|
%li= link_to identifier.name, identifier.url, target: '_blank', rel: 'noopener noreferrer'
......
......@@ -80,7 +80,7 @@ describe Projects::Security::VulnerabilitiesController do
it 'renders the file location' do
show_vulnerability
expect(response.body).to have_text(vulnerability.finding.location["file"])
expect(response.body).to have_text(vulnerability.finding.location['file'])
end
it 'renders the solution card' do
......
......@@ -142,6 +142,7 @@ describe VulnerabilitiesHelper do
it 'uses the default branch' do
vulnerability.finding.pipelines = []
vulnerability.finding.save
expect(subject).to include(
vulnerability.project.default_branch
)
......@@ -152,6 +153,7 @@ describe VulnerabilitiesHelper do
it 'does not include a reference to the line number' do
vulnerability.finding.location['start_line'] = nil
vulnerability.finding.save
expect(subject).not_to include('#L')
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