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
659ef546
Commit
659ef546
authored
Nov 08, 2016
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: Return 400 when creating a systemhook fails
parent
c392b0cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
changelogs/unreleased/api-return-400-if-post-systemhook-fails.yml
...gs/unreleased/api-return-400-if-post-systemhook-fails.yml
+4
-0
lib/api/system_hooks.rb
lib/api/system_hooks.rb
+1
-1
spec/requests/api/system_hooks_spec.rb
spec/requests/api/system_hooks_spec.rb
+6
-0
No files found.
changelogs/unreleased/api-return-400-if-post-systemhook-fails.yml
0 → 100644
View file @
659ef546
---
title
:
Return 400 when creating a system hook fails
merge_request
:
7350
author
:
Robert Schilling
lib/api/system_hooks.rb
View file @
659ef546
...
@@ -32,7 +32,7 @@ module API
...
@@ -32,7 +32,7 @@ module API
if
hook
.
save
if
hook
.
save
present
hook
,
with:
Entities
::
Hook
present
hook
,
with:
Entities
::
Hook
else
else
not_found!
render_validation_error!
(
hook
)
end
end
end
end
...
...
spec/requests/api/system_hooks_spec.rb
View file @
659ef546
...
@@ -52,6 +52,12 @@ describe API::API, api: true do
...
@@ -52,6 +52,12 @@ describe API::API, api: true do
expect
(
response
).
to
have_http_status
(
400
)
expect
(
response
).
to
have_http_status
(
400
)
end
end
it
"responds with 400 if url is invalid"
do
post
api
(
"/hooks"
,
admin
),
url:
'hp://mep.mep'
expect
(
response
).
to
have_http_status
(
400
)
end
it
"does not create new hook without url"
do
it
"does not create new hook without url"
do
expect
do
expect
do
post
api
(
"/hooks"
,
admin
)
post
api
(
"/hooks"
,
admin
)
...
...
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