Commit f0e417091c2cef32b560472a38f66cf6cdcaec15

Authored by Sebastian Ziebell
2 parents 512d826c ba1a453e

Merge branch 'master' into fixes/api

Conflicts:
	spec/requests/api/projects_spec.rb
doc/api/projects.md
... ... @@ -354,7 +354,7 @@ Removes a hook from project. This is an idempotent method and can be called mult
354 354 Either the hook is available or not.
355 355  
356 356 ```
357   -DELETE /projects/:id/hooks
  357 +DELETE /projects/:id/hooks/:hook_id
358 358 ```
359 359  
360 360 Parameters:
... ...
lib/api/projects.rb
... ... @@ -244,8 +244,8 @@ module Gitlab
244 244 # id (required) - The ID of a project
245 245 # hook_id (required) - The ID of hook to delete
246 246 # Example Request:
247   - # DELETE /projects/:id/hooks
248   - delete ":id/hooks" do
  247 + # DELETE /projects/:id/hooks/:hook_id
  248 + delete ":id/hooks/:hook_id" do
249 249 authorize! :admin_project, user_project
250 250 bad_request!(:hook_id) unless params.has_key? :hook_id
251 251  
... ...
spec/requests/api/projects_spec.rb
... ... @@ -384,7 +384,7 @@ describe Gitlab::API do
384 384 it "should add hook to project" do
385 385 expect {
386 386 post api("/projects/#{project.id}/hooks", user),
387   - "url" => "http://example.com"
  387 + url: "http://example.com"
388 388 }.to change {project.hooks.count}.by(1)
389 389 response.status.should == 201
390 390 end
... ... @@ -424,11 +424,10 @@ describe Gitlab::API do
424 424 end
425 425 end
426 426  
427   - describe "DELETE /projects/:id/hooks" do
  427 + describe "DELETE /projects/:id/hooks/:hook_id" do
428 428 it "should delete hook from project" do
429 429 expect {
430   - delete api("/projects/#{project.id}/hooks", user),
431   - hook_id: hook.id
  430 + delete api("/projects/#{project.id}/hooks/#{hook.id}", user)
432 431 }.to change {project.hooks.count}.by(-1)
433 432 response.status.should == 200
434 433 end
... ...