Commit 29e60d47 authored by Alan Paruszewski's avatar Alan Paruszewski

Add last fetched at timestamp on show vulnerability page

parent 6fdd8b52
...@@ -11,7 +11,8 @@ module VulnerabilitiesHelper ...@@ -11,7 +11,8 @@ module VulnerabilitiesHelper
pipeline_json: vulnerability_pipeline_data(pipeline).to_json, pipeline_json: vulnerability_pipeline_data(pipeline).to_json,
has_mr: !!vulnerability.finding.merge_request_feedback.try(:merge_request_iid), has_mr: !!vulnerability.finding.merge_request_feedback.try(:merge_request_iid),
vulnerability_feedback_help_path: help_page_path('user/application_security/index', anchor: 'interacting-with-the-vulnerabilities'), vulnerability_feedback_help_path: help_page_path('user/application_security/index', anchor: 'interacting-with-the-vulnerabilities'),
finding_json: vulnerability_finding_data(vulnerability.finding).to_json finding_json: vulnerability_finding_data(vulnerability.finding).to_json,
timestamp: Time.now.to_i
} }
end end
......
...@@ -49,6 +49,10 @@ describe VulnerabilitiesHelper do ...@@ -49,6 +49,10 @@ describe VulnerabilitiesHelper do
expect(occurrence_serializer_stub).to receive(:represent).with(finding).and_return(occurrence_serializer_hash) expect(occurrence_serializer_stub).to receive(:represent).with(finding).and_return(occurrence_serializer_hash)
end end
around do |example|
Timecop.freeze { example.run }
end
it 'has expected vulnerability properties' do it 'has expected vulnerability properties' do
expect(subject).to include( expect(subject).to include(
vulnerability_json: kind_of(String), vulnerability_json: kind_of(String),
...@@ -56,7 +60,8 @@ describe VulnerabilitiesHelper do ...@@ -56,7 +60,8 @@ describe VulnerabilitiesHelper do
create_issue_url: kind_of(String), create_issue_url: kind_of(String),
has_mr: anything, has_mr: anything,
vulnerability_feedback_help_path: kind_of(String), vulnerability_feedback_help_path: kind_of(String),
finding_json: kind_of(String) finding_json: kind_of(String),
timestamp: Time.now.to_i
) )
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