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
0469b44a
Commit
0469b44a
authored
Jun 23, 2021
by
Dave Pisek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for commit_path_template
parent
f313562f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/commit.vue
...ulnerabilities/components/generic_report/types/commit.vue
+1
-1
spec/helpers/commits_helper_spec.rb
spec/helpers/commits_helper_spec.rb
+10
-0
No files found.
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/commit.vue
View file @
0469b44a
...
...
@@ -17,7 +17,7 @@ export default {
// search for all occurences of "$COMMIT_SHA" within the given template, eg.: "/base/project/path/-/commit/$COMMIT_SHA"
const
allCommitShaPlaceHolders
=
/
\$
COMMIT_SHA/g
;
// Replace it with the actual commit hash
// NOTE: This can be swapped to using `
replaceAll` once it's more widely supported
// NOTE: This can be swapped to using `
String.prototype.replaceAll` once it's more widely supported (https://caniuse.com/?search=replaceAll)
return
this
.
commitPathTemplate
.
replace
(
allCommitShaPlaceHolders
,
this
.
value
);
},
},
...
...
spec/helpers/commits_helper_spec.rb
View file @
0469b44a
...
...
@@ -321,4 +321,14 @@ RSpec.describe CommitsHelper do
it
{
is_expected
.
to
include
(
pipeline
.
cache_key
)
}
end
end
describe
"#commit_path_template"
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
"returns the correct path"
do
expect
(
helper
.
commit_path_template
(
project
))
.
to
eq
(
"/
#{
project
.
namespace
.
full_path
}
/
#{
project
.
name
}
/-/commit/$COMMIT_SHA"
)
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