Commit 48388541 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC

Fix Vulnerabilities::Finding#remediations method

parent 04f0ec2a
......@@ -241,7 +241,7 @@ module Vulnerabilities
def remediations
return metadata.dig('remediations') unless super.present?
super.as_json(only: [:summary, :diff])
super.as_json(only: [:summary], methods: [:diff])
end
def build_evidence_request(data)
......
......@@ -461,7 +461,7 @@ RSpec.describe Vulnerabilities::Finding do
context 'when the finding has associated remediation records' do
let!(:persisted_remediation) { create(:vulnerabilities_remediation, findings: [finding]) }
let(:remediation_hash) { persisted_remediation.as_json(only: [:summary, :diff]) }
let(:remediation_hash) { { 'summary' => persisted_remediation.summary, 'diff' => persisted_remediation.diff } }
it { is_expected.to eq([remediation_hash]) }
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