Commit 3f2e0425 authored by jozefvaclavik's avatar jozefvaclavik

Update projects_spec.rb for Hook list and edit

Also (I think) I found few mistakes with snippets requests.
parent d0000e5c
......@@ -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),
......@@ -181,6 +189,17 @@ describe Gitlab::API do
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
expect {
......@@ -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'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment