Commit f0e417091c2cef32b560472a38f66cf6cdcaec15
Exists in
master
and in
4 other branches
Merge branch 'master' into fixes/api
Conflicts: spec/requests/api/projects_spec.rb
Showing
3 changed files
with
6 additions
and
7 deletions
Show diff stats
doc/api/projects.md
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 | ... | ... |