Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-27 17:36:20 +0400
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-27 17:36:20 +0400
commite96d77d3dbd789981b8e85e7afba9a5908d79483 (patch)
treebb1a3a05d5a739116cd0efea45033d63a244fa82 /spec
parentdffc2b8a8b3ed03f12dc8f41a6f24b96f2605268 (diff)
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.
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/issues_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
index 630ac0f820a..ecf0bdb7084 100644
--- a/spec/requests/api/issues_spec.rb
+++ b/spec/requests/api/issues_spec.rb
@@ -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