added api method to return labels of a given project
Created by: abner
This add a feature to api to allow return a list of labels of a project.
Created by: jvanbaarsen
@abner Thanks for your contribution! What do you think about moving the specs into the
api/project_spec.rb
file? TheGET /projects/:id/snippets
is also in there. And you also did the change inproject.rb
By Administrator on 2014-03-21T18:42:51 (imported from GitLab project)
632 633 end 633 634 end 634 635 end 636 637 describe "GET /projects/:id/labels" do 638 before { issue_with_labels } 639 640 it "should return project labels" do 641 get api("/projects/#{project.id}/labels", user) 642 response.status.should == 200 643 json_response.should be_an Array 644 json_response.first['name'].should == issue_with_labels.labels.first.name 645 json_response.last['name'].should == issue_with_labels.labels.last.name 215 215 @users = paginate @users 216 216 present @users, with: Entities::User 217 217 end 218 219 # Get a project labels 220 # 221 # Parameters: 222 # id (required) - The ID of a project 632 633 end 633 634 end 634 635 end 636 637 describe "GET /projects/:id/labels" do 638 before { issue_with_labels } 639 640 it "should return project labels" do 641 get api("/projects/#{project.id}/labels", user) 642 response.status.should == 200 643 json_response.should be_an Array 644 json_response.first['name'].should == issue_with_labels.labels.first.name 645 json_response.last['name'].should == issue_with_labels.labels.last.name 215 215 @users = paginate @users 216 216 present @users, with: Entities::User 217 217 end 218 219 # Get a project labels 220 # 221 # Parameters: 222 # id (required) - The ID of a project 632 633 end 633 634 end 634 635 end 636 637 describe "GET /projects/:id/labels" do 638 before { issue_with_labels } 639 640 it "should return project labels" do 641 get api("/projects/#{project.id}/labels", user) 642 response.status.should == 200 643 json_response.should be_an Array 644 json_response.first['name'].should == issue_with_labels.labels.first.name 645 json_response.last['name'].should == issue_with_labels.labels.last.name 215 215 @users = paginate @users 216 216 present @users, with: Entities::User 217 217 end 218 219 # Get a project labels 220 # 221 # Parameters: 222 # id (required) - The ID of a project Created by: Razer6
Corresponding Feature request: https://gitlab.uservoice.com/admin/forums/176466-general/suggestions/5495352-api-to-get-issues-lables-list
By Administrator on 2014-03-24T08:28:26 (imported from GitLab project)
Please register or sign in to reply