Update projects_spec.rb for Hook list and edit
Also (I think) I found few mistakes with snippets requests.
This commit is contained in:
parent
d0000e5c18
commit
3f2e04254f
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue