Commit 33c513274d2201787d592850e60a018b777e0c43
1 parent
b7ac654b
Exists in
master
and in
4 other branches
Fix RESTfulness of project hook deletions by API
Showing
3 changed files
with
5 additions
and
6 deletions
Show diff stats
doc/api/projects.md
lib/api/projects.rb
... | ... | @@ -205,8 +205,8 @@ module Gitlab |
205 | 205 | # id (required) - The ID of a project |
206 | 206 | # hook_id (required) - The ID of hook to delete |
207 | 207 | # Example Request: |
208 | - # DELETE /projects/:id/hooks | |
209 | - delete ":id/hooks" do | |
208 | + # DELETE /projects/:id/hooks/:hook_id | |
209 | + delete ":id/hooks/:hook_id" do | |
210 | 210 | authorize! :admin_project, user_project |
211 | 211 | @hook = user_project.hooks.find(params[:hook_id]) |
212 | 212 | @hook.destroy | ... | ... |
spec/requests/api/projects_spec.rb
... | ... | @@ -275,11 +275,10 @@ describe Gitlab::API do |
275 | 275 | end |
276 | 276 | end |
277 | 277 | |
278 | - | |
279 | - describe "DELETE /projects/:id/hooks" do | |
278 | + describe "DELETE /projects/:id/hooks/:hook_id" do | |
280 | 279 | it "should delete hook from project" do |
281 | 280 | expect { |
282 | - delete api("/projects/#{project.id}/hooks", user), | |
281 | + delete api("/projects/#{project.id}/hooks/#{hook.id}", user), | |
283 | 282 | hook_id: hook.id |
284 | 283 | }.to change {project.hooks.count}.by(-1) |
285 | 284 | end | ... | ... |