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
Tatuya Kamada
gitlab-ce
Commits
2448fa69
Commit
2448fa69
authored
Jan 03, 2017
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project hooks params
parent
8daff07c
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 @
2448fa69
...
@@ -15,7 +15,7 @@ module API
...
@@ -15,7 +15,7 @@ module API
optional
:note_events
,
type:
Boolean
,
desc:
"Trigger hook on note(comment) events"
optional
:note_events
,
type:
Boolean
,
desc:
"Trigger hook on note(comment) events"
optional
:build_events
,
type:
Boolean
,
desc:
"Trigger hook on build events"
optional
:build_events
,
type:
Boolean
,
desc:
"Trigger hook on build events"
optional
:pipeline_events
,
type:
Boolean
,
desc:
"Trigger hook on pipeline 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
: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"
optional
:token
,
type:
String
,
desc:
"Secret token to validate received payloads; this will not be returned in the response"
end
end
...
...
spec/requests/api/project_hooks_spec.rb
View file @
2448fa69
...
@@ -86,7 +86,8 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
...
@@ -86,7 +86,8 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
describe
"POST /projects/:id/hooks"
do
describe
"POST /projects/:id/hooks"
do
it
"adds hook to project"
do
it
"adds hook to project"
do
expect
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
)
end
.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
expect
(
response
).
to
have_http_status
(
201
)
expect
(
response
).
to
have_http_status
(
201
)
...
@@ -98,7 +99,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
...
@@ -98,7 +99,7 @@ describe API::ProjectHooks, 'ProjectHooks', api: true do
expect
(
json_response
[
'note_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'note_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'build_events'
]).
to
eq
(
false
)
expect
(
json_response
[
'pipeline_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
[
'enable_ssl_verification'
]).
to
eq
(
true
)
expect
(
json_response
).
not_to
include
(
'token'
)
expect
(
json_response
).
not_to
include
(
'token'
)
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