Commit ae40e855efc393d752f290ed8eda67961874acf5
1 parent
82bd0904
Exists in
master
and in
4 other branches
API: test checks a 400 code is returned if snippet title not given
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
spec/requests/api/projects_spec.rb
@@ -400,6 +400,12 @@ describe Gitlab::API do | @@ -400,6 +400,12 @@ describe Gitlab::API do | ||
400 | response.status.should == 201 | 400 | response.status.should == 201 |
401 | json_response['title'].should == 'api test' | 401 | json_response['title'].should == 'api test' |
402 | end | 402 | end |
403 | + | ||
404 | + it "should return a 400 error if title is not given" do | ||
405 | + post api("/projects/#{project.id}/snippets", user), | ||
406 | + file_name: 'sample.rb', code: 'test' | ||
407 | + response.status.should == 400 | ||
408 | + end | ||
403 | end | 409 | end |
404 | 410 | ||
405 | describe "PUT /projects/:id/snippets/:shippet_id" do | 411 | describe "PUT /projects/:id/snippets/:shippet_id" do |