diff options
author | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-13 10:29:42 +0100 |
---|---|---|
committer | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-13 10:29:42 +0100 |
commit | ae40e855efc393d752f290ed8eda67961874acf5 (patch) | |
tree | 4f4dcbc561d16d724f6792537b11802ef6d16b78 | |
parent | 82bd0904ffb34e16ac66fb83a9ce79a5845ce78b (diff) | |
download | gitlab-ce-ae40e855efc393d752f290ed8eda67961874acf5.tar.gz |
API: test checks a 400 code is returned if snippet title not given
-rw-r--r-- | spec/requests/api/projects_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 1e77baf7f6a..9881ece3506 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -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 |