API documentation updated for project snippets.
The API Documentation for project snippets got infos to return codes. Tests are added to check status codes when handling project snippets.
This commit is contained in:
parent
ce9e35c295
commit
9ee6c58acc
2 changed files with 64 additions and 18 deletions
|
@ -480,6 +480,11 @@ 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
|
||||
|
@ -520,6 +525,12 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue