summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-20 14:30:11 +0100
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-20 14:30:11 +0100
commitf0e417091c2cef32b560472a38f66cf6cdcaec15 (patch)
tree1b4a06460786d2c9e35057ac9e5c1b54b2bef356
parent512d826cc3e89bb577f485d4767d91185f3f0556 (diff)
parentba1a453ef3dddf50a2c118f4490267b19a0b2cc8 (diff)
downloadgitlab-ce-f0e417091c2cef32b560472a38f66cf6cdcaec15.tar.gz
Merge branch 'master' into fixes/api
Conflicts: spec/requests/api/projects_spec.rb
-rw-r--r--doc/api/projects.md2
-rw-r--r--lib/api/projects.rb4
-rw-r--r--spec/requests/api/projects_spec.rb7
3 files changed, 6 insertions, 7 deletions
diff --git a/doc/api/projects.md b/doc/api/projects.md
index cff4327a58c..2e13ccb88d4 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -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:
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index d171acc1ce1..65381dac6ac 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -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
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 06ab0f5e684..9fbdd52eefc 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -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