BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
67ca15bb
Commit
67ca15bb
authored
Nov 08, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-systemhook-api' into 'master'
API: Return 400 when creating a systemhook fails Closes #23335 See merge request !7350
parents
55e0065b
659ef546
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
api-return-400-if-post-systemhook-fails.yml
...gs/unreleased/api-return-400-if-post-systemhook-fails.yml
+4
-0
system_hooks.rb
lib/api/system_hooks.rb
+1
-1
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 @
67ca15bb
---
title
:
Return 400 when creating a system hook fails
merge_request
:
7350
author
:
Robert Schilling
lib/api/system_hooks.rb
View file @
67ca15bb
...
...
@@ -32,7 +32,7 @@ module API
if
hook
.
save
present
hook
,
with:
Entities
::
Hook
else
not_found!
render_validation_error!
(
hook
)
end
end
...
...
spec/requests/api/system_hooks_spec.rb
View file @
67ca15bb
...
...
@@ -52,6 +52,12 @@ describe API::API, api: true do
expect
(
response
).
to
have_http_status
(
400
)
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
expect
do
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