diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-30 17:05:43 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-30 17:05:43 +0400 |
commit | 70f868b737af99c8a8697a3cb5e19b8da3d9c3d9 (patch) | |
tree | 1124b60e0e2a3583a7be04f0311758654a7ca0db /spec/requests/api/labels_spec.rb | |
parent | 593df8e69a81a3ab0a4755db74dc282c00e02ef5 (diff) |
Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/requests/api/labels_spec.rb')
-rw-r--r-- | spec/requests/api/labels_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb new file mode 100644 index 00000000000..d40c2c21cec --- /dev/null +++ b/spec/requests/api/labels_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe API::API, api: true do + include ApiHelpers + + let(:user) { create(:user) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } + let!(:label1) { create(:label, title: 'label1', project: project) } + + before do + project.team << [user, :master] + end + + + 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.size.should == 1 + json_response.first['name'].should == label1.name + end + end +end |