Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3aede137
Commit
3aede137
authored
Nov 03, 2021
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify rendering JIRA issue description
parent
4a307a69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
ee/app/helpers/vulnerabilities_helper.rb
ee/app/helpers/vulnerabilities_helper.rb
+5
-6
ee/spec/helpers/vulnerabilities_helper_spec.rb
ee/spec/helpers/vulnerabilities_helper_spec.rb
+3
-8
No files found.
ee/app/helpers/vulnerabilities_helper.rb
View file @
3aede137
...
...
@@ -46,12 +46,11 @@ module VulnerabilitiesHelper
decorated_vulnerability
=
vulnerability
.
present
summary
=
_
(
'Investigate vulnerability: %{title}'
)
%
{
title:
decorated_vulnerability
.
title
}
description
=
ApplicationController
.
render
(
template:
{
partial:
'vulnerabilities/jira_issue_description'
,
formats: :md
,
handlers: :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
...
...
ee/spec/helpers/vulnerabilities_helper_spec.rb
View file @
3aede137
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment