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
2b87d524
Commit
2b87d524
authored
Oct 11, 2021
by
Tom Quirk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for hook_log_path helper
parent
56df1f0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
spec/helpers/hooks_helper_spec.rb
spec/helpers/hooks_helper_spec.rb
+22
-1
No files found.
spec/helpers/hooks_helper_spec.rb
View file @
2b87d524
...
...
@@ -6,9 +6,10 @@ RSpec.describe HooksHelper do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project_hook
)
{
create
(
:project_hook
,
project:
project
)
}
let
(
:system_hook
)
{
create
(
:system_hook
)
}
let
(
:trigger
)
{
'push_events'
}
describe
'#link_to_test_hook'
do
let
(
:trigger
)
{
'push_events'
}
it
'returns project namespaced link'
do
expect
(
helper
.
link_to_test_hook
(
project_hook
,
trigger
))
.
to
include
(
"href=
\"
#{
test_project_hook_path
(
project
,
project_hook
,
trigger:
trigger
)
}
\"
"
)
...
...
@@ -19,4 +20,24 @@ RSpec.describe HooksHelper do
.
to
include
(
"href=
\"
#{
test_admin_hook_path
(
system_hook
,
trigger:
trigger
)
}
\"
"
)
end
end
describe
'#hook_log_path'
do
context
'with a project hook'
do
let
(
:web_hook_log
)
{
create
(
:web_hook_log
,
web_hook:
project_hook
)
}
it
'returns project-namespaced link'
do
expect
(
helper
.
hook_log_path
(
project_hook
,
web_hook_log
))
.
to
eq
(
web_hook_log
.
present
.
details_path
)
end
end
context
'with a system hook'
do
let
(
:web_hook_log
)
{
create
(
:web_hook_log
,
web_hook:
system_hook
)
}
it
'returns admin-namespaced link'
do
expect
(
helper
.
hook_log_path
(
system_hook
,
web_hook_log
))
.
to
eq
(
admin_hook_hook_log_path
(
system_hook
,
web_hook_log
))
end
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