diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 94c9abb3..87d981a0 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -172,7 +172,15 @@ describe Gitlab::API do end end - describe "POST /projects/:id/users" do + describe "GET /projects/:id/hooks/:hook_id" do + it "should return a project hook" do + get api("/projects/#{project.code}/hooks/#{hook.id}", user) + response.status.should == 200 + json_response['url'].should == hook.url + end + end + + describe "POST /projects/:id/hooks" do it "should add hook to project" do expect { post api("/projects/#{project.code}/hooks", user), @@ -180,6 +188,17 @@ describe Gitlab::API do }.to change {project.hooks.count}.by(1) end end + + describe "PUT /projects/:id/hooks/:hook_id" do + it "should update an existing project hook" do + put api("/projects/#{project.code}/hooks/#{hook.id}", user), + code: 'updated code' + response.status.should == 200 + json_response['url'].should == 'http://example.com' + hook.reload.content.should == 'updated code' + end + end + describe "DELETE /projects/:id/hooks" do it "should delete hook from project" do @@ -246,7 +265,7 @@ describe Gitlab::API do end end - describe "PUT /projects/:id/snippets" do + describe "PUT /projects/:id/snippets/:shippet_id" do it "should update an existing project snippet" do put api("/projects/#{project.code}/snippets/#{snippet.id}", user), code: 'updated code'