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
ba1a453e
Commit
ba1a453e
authored
Feb 20, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3053 from m4tthumphrey/api-delete-hook-by-id
Fix RESTfulness of project hook deletions by API
parents
b7ac654b
dddf6eab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
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
+3
-5
No files found.
doc/api/projects.md
View file @
ba1a453e
...
@@ -265,7 +265,7 @@ Will return status `201 Created` on success, or `404 Not found` on fail.
...
@@ -265,7 +265,7 @@ Will return status `201 Created` on success, or `404 Not found` on fail.
Delete hook from project
Delete hook from project
```
```
DELETE /projects/:id/hooks
DELETE /projects/:id/hooks
/:hook_id
```
```
Parameters:
Parameters:
...
...
lib/api/projects.rb
View file @
ba1a453e
...
@@ -205,8 +205,8 @@ module Gitlab
...
@@ -205,8 +205,8 @@ module Gitlab
# id (required) - The ID of a project
# id (required) - The ID of a project
# hook_id (required) - The ID of hook to delete
# hook_id (required) - The ID of hook to delete
# Example Request:
# Example Request:
# DELETE /projects/:id/hooks
# DELETE /projects/:id/hooks
/:hook_id
delete
":id/hooks"
do
delete
":id/hooks
/:hook_id
"
do
authorize!
:admin_project
,
user_project
authorize!
:admin_project
,
user_project
@hook
=
user_project
.
hooks
.
find
(
params
[
:hook_id
])
@hook
=
user_project
.
hooks
.
find
(
params
[
:hook_id
])
@hook
.
destroy
@hook
.
destroy
...
...
spec/requests/api/projects_spec.rb
View file @
ba1a453e
...
@@ -261,7 +261,7 @@ describe Gitlab::API do
...
@@ -261,7 +261,7 @@ describe Gitlab::API do
it
"should add hook to project"
do
it
"should add hook to project"
do
expect
{
expect
{
post
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
post
api
(
"/projects/
#{
project
.
id
}
/hooks"
,
user
),
"url"
=>
"http://example.com"
url:
"http://example.com"
}.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
}.
to
change
{
project
.
hooks
.
count
}.
by
(
1
)
end
end
end
end
...
@@ -275,12 +275,10 @@ describe Gitlab::API do
...
@@ -275,12 +275,10 @@ describe Gitlab::API do
end
end
end
end
describe
"DELETE /projects/:id/hooks/:hook_id"
do
describe
"DELETE /projects/:id/hooks"
do
it
"should delete hook from project"
do
it
"should delete hook from project"
do
expect
{
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
)
}.
to
change
{
project
.
hooks
.
count
}.
by
(
-
1
)
end
end
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