API: add project snippets listing

This commit is contained in:
Nihad Abbasov 2012-10-08 02:13:53 -07:00
parent ad5b5d1e51
commit 61f12da3a5
4 changed files with 29 additions and 1 deletions

View file

@ -220,6 +220,15 @@ describe Gitlab::API do
end
end
describe "GET /projects/:id/snippets" do
it "should return a project snippet" do
get api("/projects/#{project.code}/snippets", user)
response.status.should == 200
json_response.should be_an Array
json_response.first['title'].should == snippet.title
end
end
describe "GET /projects/:id/snippets/:snippet_id" do
it "should return a project snippet" do
get api("/projects/#{project.code}/snippets/#{snippet.id}", user)