diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-25 21:39:16 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-25 21:39:16 +0400 |
commit | a7aacb4dc4d2cb3875db22dee830553462100a20 (patch) | |
tree | 892278f1ce71d632269ce0a9e24ee9b7f7c093c3 /spec | |
parent | 5fc3d746d22ffafb881187a7ce5280d973a1cad4 (diff) | |
parent | 19938156d89ea980596fd5b1d72856f3defb228a (diff) |
Merge pull request #6586 from abner/master
added api method to return labels of a given project
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 149c5bffcda..7fe65639657 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -13,6 +13,7 @@ describe API::API do let(:snippet) { create(:project_snippet, author: user, project: project, title: 'example') } let(:users_project) { create(:users_project, user: user, project: project, project_access: UsersProject::MASTER) } let(:users_project2) { create(:users_project, user: user3, project: project, project_access: UsersProject::DEVELOPER) } + let(:issue_with_labels) { create(:issue, author: user, assignee: user, project: project, :label_list => "label1, label2") } describe "GET /projects" do before { project } @@ -632,4 +633,16 @@ describe API::API do end end end + + describe "GET /projects/:id/labels" do + before { issue_with_labels } + + it "should return project labels" do + get api("/projects/#{project.id}/labels", user) + response.status.should == 200 + json_response.should be_an Array + json_response.first['name'].should == issue_with_labels.labels.first.name + json_response.last['name'].should == issue_with_labels.labels.last.name + end + end end |