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
77abe255
Commit
77abe255
authored
Mar 07, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow all parameters of group webhooks to be set through the UI
parent
d04a47c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
3 deletions
+54
-3
app/controllers/groups/hooks_controller.rb
app/controllers/groups/hooks_controller.rb
+14
-3
changelogs/unreleased-ee/1853-fix-group-webhook-token.yml
changelogs/unreleased-ee/1853-fix-group-webhook-token.yml
+4
-0
spec/controllers/groups/hooks_controller_spec.rb
spec/controllers/groups/hooks_controller_spec.rb
+36
-0
No files found.
app/controllers/groups/hooks_controller.rb
View file @
77abe255
...
...
@@ -53,8 +53,19 @@ class Groups::HooksController < Groups::ApplicationController
end
def
hook_params
params
.
require
(
:hook
).
permit
(
:url
,
:push_events
,
:issues_events
,
:merge_requests_events
,
:tag_push_events
,
:note_events
,
:build_events
,
:enable_ssl_verification
)
params
.
require
(
:hook
).
permit
(
:build_events
,
:confidential_issues_events
,
:enable_ssl_verification
,
:issues_events
,
:merge_requests_events
,
:note_events
,
:pipeline_events
,
:push_events
,
:tag_push_events
,
:token
,
:url
,
:wiki_page_events
)
end
end
changelogs/unreleased-ee/1853-fix-group-webhook-token.yml
0 → 100644
View file @
77abe255
---
title
:
Allow all parameters of group webhooks to be set through the UI
merge_request
:
1376
author
:
spec/controllers/groups/hooks_controller_spec.rb
0 → 100644
View file @
77abe255
require
'spec_helper'
describe
Groups
::
HooksController
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
before
do
group
.
add_owner
(
user
)
sign_in
(
user
)
end
describe
'POST #create'
do
it
'sets all parameters'
do
hook_params
=
{
build_events:
true
,
confidential_issues_events:
true
,
enable_ssl_verification:
true
,
issues_events:
true
,
merge_requests_events:
true
,
note_events:
true
,
pipeline_events:
true
,
push_events:
true
,
tag_push_events:
true
,
token:
"TEST TOKEN"
,
url:
"http://example.com"
,
wiki_page_events:
true
,
}
post
:create
,
group_id:
group
.
to_param
,
hook:
hook_params
expect
(
response
).
to
have_http_status
(
302
)
expect
(
group
.
hooks
.
size
).
to
eq
(
1
)
expect
(
group
.
hooks
.
first
).
to
have_attributes
(
hook_params
)
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