Commit ed14a065 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'issue_342492_7' into 'master'

Pass formats explicitly when rendering .md.erb

See merge request gitlab-org/gitlab!73420
parents 2f02dc07 3aede137
......@@ -46,8 +46,11 @@ module VulnerabilitiesHelper
decorated_vulnerability = vulnerability.present
summary = _('Investigate vulnerability: %{title}') % { title: decorated_vulnerability.title }
description = ApplicationController.render(template: 'vulnerabilities/jira_issue_description.md.erb',
locals: { vulnerability: decorated_vulnerability })
description = ApplicationController.render(
template: 'vulnerabilities/jira_issue_description',
formats: :md,
locals: { vulnerability: decorated_vulnerability }
)
vulnerability.project.jira_integration.new_issue_url_with_predefined_fields(summary, description)
end
......
......@@ -225,12 +225,6 @@ RSpec.describe VulnerabilitiesHelper do
JIRA
end
it 'renders description using dedicated template' do
expect(ApplicationController).to receive(:render).with(template: 'vulnerabilities/jira_issue_description.md.erb', locals: { vulnerability: an_instance_of(VulnerabilityPresenter) })
subject
end
it 'delegates rendering URL to Integrations::Jira' do
expect(jira_integration).to receive(:new_issue_url_with_predefined_fields).with("Investigate vulnerability: #{vulnerability.title}", expected_jira_issue_description)
......@@ -247,8 +241,9 @@ RSpec.describe VulnerabilitiesHelper do
end
it 'renders description using dedicated template without raising error' do
expect(ApplicationController).to receive(:render).with(template: 'vulnerabilities/jira_issue_description.md.erb', locals: { vulnerability: an_instance_of(VulnerabilityPresenter) })
expect {subject}.not_to raise_error
expect(jira_integration).to receive(:new_issue_url_with_predefined_fields).with("Investigate vulnerability: #{vulnerability.title}", expected_jira_issue_description)
subject
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