Commit 13c5ed14 authored by Michał Zając's avatar Michał Zając

Check if the IssueLink is valid

parent 3ad54556
...@@ -285,9 +285,9 @@ RSpec.describe Security::StoreReportService, '#execute' do ...@@ -285,9 +285,9 @@ RSpec.describe Security::StoreReportService, '#execute' do
end end
end end
context 'when there is an assoiciated issue feedback with finding' do context 'when there is an associated issue feedback with finding' do
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:issue_feedback) do let!(:issue_feedback) do
create( create(
:vulnerability_feedback, :vulnerability_feedback,
:sast, :sast,
...@@ -299,9 +299,22 @@ RSpec.describe Security::StoreReportService, '#execute' do ...@@ -299,9 +299,22 @@ RSpec.describe Security::StoreReportService, '#execute' do
end end
it 'inserts issue links from the new pipeline' do it 'inserts issue links from the new pipeline' do
issue_feedback
expect { subject }.to change { Vulnerabilities::IssueLink.count }.by(1) expect { subject }.to change { Vulnerabilities::IssueLink.count }.by(1)
end end
it 'the issue link is valid' do
subject
finding = Vulnerabilities::Finding.find_by(uuid: new_report.findings.first.uuid)
vulnerability_id = finding.vulnerability_id
issue_id = issue.id
issue_link = Vulnerabilities::IssueLink.find_by(
vulnerability_id: vulnerability_id,
issue_id: issue_id
)
expect(issue_link).not_to be_nil
end
end end
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