Commit 654fb040 authored by Jonathan Schafer's avatar Jonathan Schafer

Put vuln finding link ingest behind feature flag

Changelog: added
parent 60578471
......@@ -9,6 +9,12 @@ module Security
self.model = Vulnerabilities::FindingLink
def execute
return unless Feature.enabled?(:vulnerability_finding_replace_metadata)
super
end
private
def attributes
......
......@@ -20,9 +20,26 @@ RSpec.describe Security::Ingestion::Tasks::IngestFindingLinks do
create(:finding_link, finding: finding_2, url: finding_link.url)
end
it 'creates finding links for the new records' do
expect { ingest_finding_links }.to change { Vulnerabilities::FindingLink.count }.by(1)
.and change { finding_1.finding_links.count }.by(1)
context 'when the replace raw metadata flag is on' do
before do
stub_feature_flags(vulnerability_finding_replace_metadata: true)
end
it 'creates finding links for the new records' do
expect { ingest_finding_links }.to change { Vulnerabilities::FindingLink.count }.by(1)
.and change { finding_1.finding_links.count }.by(1)
end
end
context 'when the replace raw metadata flag is off' do
before do
stub_feature_flags(vulnerability_finding_replace_metadata: false)
end
it 'does not create finding links for the new records' do
expect { ingest_finding_links }.to change { Vulnerabilities::FindingLink.count }.by(0)
.and change { finding_1.finding_links.count }.by(0)
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