API: test checks a 400 code is returned if snippet title not given

This commit is contained in:
Sebastian Ziebell 2013-02-13 10:29:42 +01:00
parent 82bd0904ff
commit ae40e855ef

View file

@ -400,6 +400,12 @@ describe Gitlab::API do
response.status.should == 201
json_response['title'].should == 'api test'
end
it "should return a 400 error if title is not given" do
post api("/projects/#{project.id}/snippets", user),
file_name: 'sample.rb', code: 'test'
response.status.should == 400
end
end
describe "PUT /projects/:id/snippets/:shippet_id" do