Commit 5c0890c3 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '209990-add-path-to-notes-and-discussions-for-vulnerability' into 'master'

Add paths for notes and discussions when presenting single vulnerability

See merge request gitlab-org/gitlab!29503
parents ad46b6cf 46b8b0ff
......@@ -8,6 +8,8 @@ module VulnerabilitiesHelper
vulnerability_json: VulnerabilitySerializer.new.represent(vulnerability).to_json,
project_fingerprint: vulnerability.finding.project_fingerprint,
create_issue_url: create_vulnerability_feedback_issue_path(vulnerability.finding.project),
notes_url: project_security_vulnerability_notes_path(vulnerability.project, vulnerability),
discussions_url: discussions_project_security_vulnerability_path(vulnerability.project, vulnerability),
pipeline_json: vulnerability_pipeline_data(pipeline).to_json,
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'),
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
describe VulnerabilitiesHelper do
let_it_be(:user) { build(:user) }
let_it_be(:vulnerability) { create(:vulnerability, :with_findings, title: "My vulnerability") }
let_it_be(:project) { vulnerability.project }
let_it_be(:finding) { vulnerability.finding }
let(:vulnerability_serializer_hash) do
vulnerability.slice(
......@@ -57,7 +58,9 @@ describe VulnerabilitiesHelper do
expect(subject).to include(
vulnerability_json: kind_of(String),
project_fingerprint: vulnerability.finding.project_fingerprint,
create_issue_url: kind_of(String),
create_issue_url: "/#{project.full_path}/-/vulnerability_feedback",
notes_url: "/#{project.full_path}/-/security/vulnerabilities/#{vulnerability.id}/notes",
discussions_url: "/#{project.full_path}/-/security/vulnerabilities/#{vulnerability.id}/discussions",
has_mr: anything,
vulnerability_feedback_help_path: kind_of(String),
finding_json: kind_of(String),
......
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