diff options
author | Ábner Silva de Oliveira <abner.silva@gmail.com> | 2014-03-22 17:29:13 -0300 |
---|---|---|
committer | Ábner Silva de Oliveira <abner.silva@gmail.com> | 2014-03-22 17:29:13 -0300 |
commit | 85b5812bc21623c6a11ed92f482ac8282ec12fc1 (patch) | |
tree | cd58798ba7f3065b0409201395e49a1efdc0485a /spec | |
parent | cc575875b6c46d384601037645970667a12c8017 (diff) | |
download | gitlab-ce-85b5812bc21623c6a11ed92f482ac8282ec12fc1.tar.gz |
moving labels specs to projects_spec file
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/labels_spec.rb | 26 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 13 |
2 files changed, 13 insertions, 26 deletions
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb deleted file mode 100644 index ba5efb6c603..00000000000 --- a/spec/requests/api/labels_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'spec_helper' - -describe API::API do - include ApiHelpers - before(:each) { ActiveRecord::Base.observers.enable(:user_observer) } - after(:each) { ActiveRecord::Base.observers.disable(:user_observer) } - - let(:user) { create(:user) } - let!(:project) { create(:project, namespace: user.namespace ) } - let!(:issue) { create(:issue, author: user, assignee: user, project: project, :label_list => "label1, label2") } - before { project.team << [user, :reporter] } - - - describe "GET /projects/:id/labels" do - 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 == 'label1' - json_response.last['name'].should == 'label2' - end - end - - -end - 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 |