Commit f978a71f41d5546be2c0c6b33052979c06912bd1
1 parent
3f4e215c
Exists in
master
and in
4 other branches
Creating MR comment without a note returns status code 400 (Bad request)
Creating a comment to an existing merge request via API without providing a note returns a status code 400 now, suggesting a bad request. The reason for this is the resource itself (MR) exists but the required property is not set.
Showing
2 changed files
with
8 additions
and
0 deletions
Show diff stats
lib/api/merge_requests.rb
spec/requests/api/merge_requests_spec.rb
... | ... | @@ -87,6 +87,11 @@ describe Gitlab::API do |
87 | 87 | response.status.should == 201 |
88 | 88 | json_response['note'].should == 'My comment' |
89 | 89 | end |
90 | + | |
91 | + it "should return 400 if note is missing" do | |
92 | + post api("/projects/#{project.id}/merge_request/#{merge_request.id}/comments", user) | |
93 | + response.status.should == 400 | |
94 | + end | |
90 | 95 | end |
91 | 96 | |
92 | 97 | end | ... | ... |