Commit a5eb25b5 authored by Michał Zając's avatar Michał Zając

Update specs for CreateService

parent 1d41deca
......@@ -26,7 +26,7 @@ describe Vulnerabilities::CreateService do
have_attributes(
author: user,
title: finding.name,
state: 'detected',
state: finding.state,
severity: finding.severity,
severity_overridden: false,
confidence: finding.confidence,
......@@ -35,6 +35,16 @@ describe Vulnerabilities::CreateService do
))
end
context 'and finding is dismissed' do
let(:finding) { create(:vulnerabilities_occurrence, :dismissed, project: project) }
it 'creates a vulnerability in a dismissed state' do
expect { subject }.to change { project.vulnerabilities.count }.by(1)
expect(project.vulnerabilities.last.state).to eq('dismissed')
end
end
it 'starts a new transaction for the create sequence' do
allow(Vulnerabilities::Occurrence).to receive(:transaction).and_call_original
......
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