Commit f0e41709 authored by Sebastian Ziebell's avatar Sebastian Ziebell

Merge branch 'master' into fixes/api

Conflicts:
	spec/requests/api/projects_spec.rb
parents 512d826c ba1a453e
......@@ -354,7 +354,7 @@ Removes a hook from project. This is an idempotent method and can be called mult
Either the hook is available or not.
```
DELETE /projects/:id/hooks
DELETE /projects/:id/hooks/:hook_id
```
Parameters:
......
......@@ -244,8 +244,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
bad_request!(:hook_id) unless params.has_key? :hook_id
......
......@@ -384,7 +384,7 @@ describe Gitlab::API do
it "should add hook to project" do
expect {
post api("/projects/#{project.id}/hooks", user),
"url" => "http://example.com"
url: "http://example.com"
}.to change {project.hooks.count}.by(1)
response.status.should == 201
end
......@@ -424,11 +424,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),
hook_id: hook.id
delete api("/projects/#{project.id}/hooks/#{hook.id}", user)
}.to change {project.hooks.count}.by(-1)
response.status.should == 200
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment