diff options
author | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-21 01:51:59 +0400 |
---|---|---|
committer | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-21 01:51:59 +0400 |
commit | 4a60c377b8cd531800757894e26cec1ac649046f (patch) | |
tree | f3e55f4ba50db6cc88a57666291d55b08583aad9 /spec | |
parent | 33c1463645b51bcb26932e4825df0ce8fee6c729 (diff) |
API documentation update for milestones
Updated the milestones API documentation and added return codes descriptions.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/milestones_spec.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/requests/api/milestones_spec.rb b/spec/requests/api/milestones_spec.rb index 00e800e8b91..c379e8a5307 100644 --- a/spec/requests/api/milestones_spec.rb +++ b/spec/requests/api/milestones_spec.rb @@ -16,6 +16,11 @@ describe Gitlab::API do json_response.should be_an Array json_response.first['title'].should == milestone.title end + + it "should return a 401 error if user not authenticated" do + get api("/projects/#{project.id}/milestones") + response.status.should == 401 + end end describe "GET /projects/:id/milestones/:milestone_id" do @@ -25,6 +30,11 @@ describe Gitlab::API do json_response['title'].should == milestone.title end + it "should return 401 error if user not authenticated" do + get api("/projects/#{project.id}/milestones/#{milestone.id}") + response.status.should == 401 + end + it "should return a 404 error if milestone id not found" do get api("/projects/#{project.id}/milestones/1234", user) response.status.should == 404 @@ -33,8 +43,7 @@ describe Gitlab::API do describe "POST /projects/:id/milestones" do it "should create a new project milestone" do - post api("/projects/#{project.id}/milestones", user), - title: 'new milestone' + post api("/projects/#{project.id}/milestones", user), title: 'new milestone' response.status.should == 201 json_response['title'].should == 'new milestone' json_response['description'].should be_nil @@ -62,7 +71,7 @@ describe Gitlab::API do json_response['title'].should == 'updated title' end - it "should return a 404 error if milestone is not found" do + it "should return a 404 error if milestone id not found" do put api("/projects/#{project.id}/milestones/1234", user), title: 'updated title' response.status.should == 404 |