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
iv
gitlab-ce
Commits
33c51327
Commit
33c51327
authored
Feb 20, 2013
by
Matt Humphrey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RESTfulness of project hook deletions by API
parent
b7ac654b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
doc/api/projects.md
doc/api/projects.md
+1
-1
lib/api/projects.rb
lib/api/projects.rb
+2
-2
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+2
-3
No files found.
doc/api/projects.md
View file @
33c51327
...
...
@@ -265,7 +265,7 @@ Will return status `201 Created` on success, or `404 Not found` on fail.
Delete hook from project
```
DELETE /projects/:id/hooks
DELETE /projects/:id/hooks
/:hook_id
```
Parameters:
...
...
lib/api/projects.rb
View file @
33c51327
...
...
@@ -205,8 +205,8 @@ module Gitlab
# id (required) - The ID of a project
# hook_id (required) - The ID of hook to delete
# Example Request:
# DELETE /projects/:id/hooks
delete
":id/hooks"
do
# DELETE /projects/:id/hooks
/:hook_id
delete
":id/hooks
/:hook_id
"
do
authorize!
:admin_project
,
user_project
@hook
=
user_project
.
hooks
.
find
(
params
[
:hook_id
])
@hook
.
destroy
...
...
spec/requests/api/projects_spec.rb
View file @
33c51327
...
...
@@ -275,11 +275,10 @@ describe Gitlab::API do
end
end
describe
"DELETE /projects/:id/hooks"
do
describe
"DELETE /projects/:id/hooks/:hook_id"
do
it
"should delete hook from project"
do
expect
{
delete
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
delete
api
(
"/projects/
#{
project
.
id
}
/hooks
/
#{
hook
.
id
}
"
,
user
),
hook_id:
hook
.
id
}.
to
change
{
project
.
hooks
.
count
}.
by
(
-
1
)
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