Commit 3e96111d authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'fix-vuln-helper' into 'master'

Fix issue with displaying solution actions

See merge request gitlab-org/gitlab!50648
parents 24b945ec 2ba934ae
...@@ -15,7 +15,7 @@ module VulnerabilitiesHelper ...@@ -15,7 +15,7 @@ module VulnerabilitiesHelper
new_issue_url: new_issue_url_for(vulnerability), new_issue_url: new_issue_url_for(vulnerability),
create_jira_issue_url: create_jira_issue_url_for(vulnerability), create_jira_issue_url: create_jira_issue_url_for(vulnerability),
related_jira_issues_path: project_integrations_jira_issues_path(vulnerability.project, vulnerability_ids: [vulnerability.id]), related_jira_issues_path: project_integrations_jira_issues_path(vulnerability.project, vulnerability_ids: [vulnerability.id]),
has_mr: !!vulnerability.finding.merge_request_feedback.try(:merge_request_iid), has_mr: !!vulnerability.finding.merge_request_feedback.try(:merge_request_id),
create_mr_url: create_vulnerability_feedback_merge_request_path(vulnerability.finding.project), create_mr_url: create_vulnerability_feedback_merge_request_path(vulnerability.finding.project),
discussions_url: discussions_project_security_vulnerability_path(vulnerability.project, vulnerability), discussions_url: discussions_project_security_vulnerability_path(vulnerability.project, vulnerability),
notes_url: project_security_vulnerability_notes_path(vulnerability.project, vulnerability), notes_url: project_security_vulnerability_notes_path(vulnerability.project, vulnerability),
......
---
title: Fix issue with displaying solution actions
merge_request: 50648
author:
type: fixed
...@@ -144,6 +144,22 @@ RSpec.describe VulnerabilitiesHelper do ...@@ -144,6 +144,22 @@ RSpec.describe VulnerabilitiesHelper do
expect(subject[:pipeline]).to be_nil expect(subject[:pipeline]).to be_nil
end end
end end
describe '[:has_mr]' do
subject { helper.vulnerability_details(vulnerability, pipeline)[:has_mr] }
context 'with existing merge request feedback' do
before do
create(:vulnerability_feedback, :merge_request, project: project, pipeline: pipeline, project_fingerprint: finding.project_fingerprint)
end
it { is_expected.to be_truthy }
end
context 'without feedback' do
it { is_expected.to be_falsey }
end
end
end end
describe '#create_jira_issue_url_for' do describe '#create_jira_issue_url_for' do
......
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