diff options
-rw-r--r-- | doc/api/projects.md | 2 | ||||
-rw-r--r-- | lib/api/projects.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 7 |
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 |