diff options
author | Valeriy Sizov <vsv2711@gmail.com> | 2012-10-12 13:23:53 +0400 |
---|---|---|
committer | Valeriy Sizov <vsv2711@gmail.com> | 2012-10-12 13:23:53 +0400 |
commit | 89a349f9a525a7fa131d0ac3704b9b770f6850d2 (patch) | |
tree | f98fc667790cdbd8e30d3aa8d593629d4eeaf782 /spec | |
parent | 3950b8e8c7528d5db79ca9b249d8a5e0ac7a02ab (diff) | |
parent | 96abbf02e3679cd883ea4ad80227f3187791da8a (diff) |
Merge pull request #1685 from jozefvaclavik/master
Hooks API (List one hook & edit)
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 94c9abb35e4..51526f89fba 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,16 @@ 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), + url: 'http://example.com' + response.status.should == 200 + json_response['url'].should == 'http://example.com' + end + end + describe "DELETE /projects/:id/hooks" do it "should delete hook from project" do @@ -246,7 +264,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' |