API: issues documentation and API functions updated
The issues documentation is updated with infos to status codes and the deprecated `DELETE` function and how to close an issue. A few more tests added to check status codes of API functions.
This commit is contained in:
parent
dffc2b8a8b
commit
e96d77d3db
3 changed files with 77 additions and 7 deletions
|
@ -41,6 +41,11 @@ describe Gitlab::API do
|
|||
response.status.should == 200
|
||||
json_response['title'].should == issue.title
|
||||
end
|
||||
|
||||
it "should return 404 if issue id not found" do
|
||||
get api("/projects/#{project.id}/issues/54321", user)
|
||||
response.status.should == 404
|
||||
end
|
||||
end
|
||||
|
||||
describe "POST /projects/:id/issues" do
|
||||
|
@ -52,6 +57,11 @@ describe Gitlab::API do
|
|||
json_response['description'].should be_nil
|
||||
json_response['labels'].should == ['label', 'label2']
|
||||
end
|
||||
|
||||
it "should return a 400 bad request if title not given" do
|
||||
post api("/projects/#{project.id}/issues", user), labels: 'label, label2'
|
||||
response.status.should == 400
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT /projects/:id/issues/:issue_id to update only title" do
|
||||
|
@ -62,6 +72,12 @@ describe Gitlab::API do
|
|||
|
||||
json_response['title'].should == 'updated title'
|
||||
end
|
||||
|
||||
it "should return 404 error if issue id not found" do
|
||||
put api("/projects/#{project.id}/issues/44444", user),
|
||||
title: 'updated title'
|
||||
response.status.should == 404
|
||||
end
|
||||
end
|
||||
|
||||
describe "PUT /projects/:id/issues/:issue_id to update state and label" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue