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

Code cleanup from MR comments

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