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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
86041ad9
Commit
86041ad9
authored
Jan 04, 2017
by
Sean McGivern
Committed by
Douglas Barbosa Alexandre
Jan 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'fix-api-project-hooks-params' into 'master'
Fix project hooks params Closes #26291 See merge request !8425
parent
dbbac3e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
lib/api/project_hooks.rb
lib/api/project_hooks.rb
+1
-1
spec/requests/api/project_hooks_spec.rb
spec/requests/api/project_hooks_spec.rb
+3
-2
No files found.
lib/api/project_hooks.rb
View file @
86041ad9
...
...
@@ -15,7 +15,7 @@ module API
optional
:note_events
,
type:
Boolean
,
desc:
"Trigger hook on note(comment) events"
optional
:build_events
,
type:
Boolean
,
desc:
"Trigger hook on build events"
optional
:pipeline_events
,
type:
Boolean
,
desc:
"Trigger hook on pipeline events"
optional
:wiki_events
,
type:
Boolean
,
desc:
"Trigger hook on wiki events"
optional
:wiki_
page_
events
,
type:
Boolean
,
desc:
"Trigger hook on wiki events"
optional
:enable_ssl_verification
,
type:
Boolean
,
desc:
"Do SSL verification when triggering the hook"
optional
:token
,
type:
String
,
desc:
"Secret token to validate received payloads; this will not be returned in the response"
end
...
...
spec/requests/api/project_hooks_spec.rb
View file @
86041ad9
...
...
@@ -86,7 +86,8 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
describe
"POST /projects/:id/hooks"
do
it
"adds hook to project"
do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
url:
"http://example.com"
,
issues_events:
true
post
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
url:
"http://example.com"
,
issues_events:
true
,
wiki_page_events:
true
end
.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
expect
(
response
).
to
have_http_status
(
201
)
...
...
@@ -98,7 +99,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
expect
(
json_response
[
'note_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'pipeline_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'wiki_page_events'
]).
to
eq
(
fals
e
)
expect
(
json_response
[
'wiki_page_events'
]).
to
eq
(
tru
e
)
expect
(
json_response
[
'enable_ssl_verification'
]).
to
eq
(
true
)
expect
(
json_response
).
not_to
include
(
'token'
)
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