Commit 3fbcc8ad authored by Alan Paruszewski's avatar Alan Paruszewski

Return individual links to issue for each finding in Pipeline Security

parent 1710adae
...@@ -205,7 +205,7 @@ module Vulnerabilities ...@@ -205,7 +205,7 @@ module Vulnerabilities
occurrence_keys.each do |occurrence_key| occurrence_keys.each do |occurrence_key|
loader.call( loader.call(
occurrence_key, occurrence_key,
feedback.select { |f| occurrence_key = f.occurrence_key } feedback.select { |f| occurrence_key == f.occurrence_key }
) )
end end
end end
......
...@@ -529,6 +529,32 @@ RSpec.describe Vulnerabilities::Occurrence do ...@@ -529,6 +529,32 @@ RSpec.describe Vulnerabilities::Occurrence do
subject(:load_feedback) { occurrence.load_feedback.to_a } subject(:load_feedback) { occurrence.load_feedback.to_a }
it { is_expected.to eq(expected_feedback) } it { is_expected.to eq(expected_feedback) }
context 'when you have multiple occurrences' do
let_it_be(:occurrence_2) do
create(
:vulnerabilities_occurrence,
report_type: :dependency_scanning,
project: project
)
end
let_it_be(:feedback_2) do
create(
:vulnerability_feedback,
:dependency_scanning,
:dismissal,
project: project,
project_fingerprint: occurrence_2.project_fingerprint
)
end
let(:expected_feedback) { [[feedback], [feedback_2]] }
subject(:load_feedback) { [occurrence, occurrence_2].map(&:load_feedback) }
it { is_expected.to eq(expected_feedback) }
end
end end
describe '#state' do describe '#state' do
......
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