mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 16:16:43 +10:00
fix API route to delete project hook
This commit is contained in:
+1
-1
@@ -274,7 +274,7 @@ module Gitlab
|
||||
# hook_id (required) - The ID of hook to delete
|
||||
# Example Request:
|
||||
# DELETE /projects/:id/hooks/:hook_id
|
||||
delete ":id/hooks" do
|
||||
delete ":id/hooks/:hook_id" do
|
||||
authorize! :admin_project, user_project
|
||||
required_attributes! [:hook_id]
|
||||
|
||||
|
||||
@@ -467,21 +467,21 @@ 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
|
||||
|
||||
it "should return success when deleting hook" do
|
||||
delete api("/projects/#{project.id}/hooks", user), hook_id: hook.id
|
||||
delete api("/projects/#{project.id}/hooks/#{hook.id}", user)
|
||||
response.status.should == 200
|
||||
end
|
||||
|
||||
it "should return success when deleting non existent hook" do
|
||||
delete api("/projects/#{project.id}/hooks", user), hook_id: 42
|
||||
delete api("/projects/#{project.id}/hooks/42", user)
|
||||
response.status.should == 200
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user