API repository documentation updated, includes infos to return codes

The API documentation of repository is updated and now contains infos to status codes.
Code documentation is also adjusted for `GET /projects/:id/repository/commits` and includes infos to
pagination attributes. Tests are updated.
This commit is contained in:
Sebastian Ziebell 2013-02-27 11:24:12 +01:00
parent ac4a09e9cc
commit e119b0a0cb
3 changed files with 73 additions and 25 deletions

View file

@ -433,14 +433,19 @@ describe Gitlab::API do
end
it "should return success when deleting hook" do
delete api("/projects/#{project.id}/hooks/#{hook.id}", user)
delete api("/projects/#{project.id}/hooks", user), hook_id: hook.id
response.status.should == 200
end
it "should return success when deleting non existent hook" do
delete api("/projects/#{project.id}/hooks/42", user)
delete api("/projects/#{project.id}/hooks", user), hook_id: 42
response.status.should == 200
end
it "should return a 400 error if hook id not given" do
delete api("/projects/#{project.id}/hooks", user)
response.status.should == 400
end
end
describe "GET /projects/:id/repository/tags" do
@ -480,11 +485,6 @@ describe Gitlab::API do
json_response.should be_an Array
json_response.first['title'].should == snippet.title
end
it "should return 401 error if user not authenticated" do
get api("/projects/#{project.id}/snippets")
response.status.should == 401
end
end
describe "GET /projects/:id/snippets/:snippet_id" do
@ -525,12 +525,6 @@ describe Gitlab::API do
title: 'api test', file_name: 'sample.rb'
response.status.should == 400
end
it "should return a 401 error if user not authenticated" do
post api("/projects/#{project.id}/snippets"),
title: 'api test', file_name: 'sample.rb', code: 'i=0'
response.status.should == 401
end
end
describe "PUT /projects/:id/snippets/:shippet_id" do