diff options
author | cnam-dep <cnam812@gmail.com> | 2016-02-24 00:59:32 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-05-09 17:07:35 +0300 |
commit | 5364400741b7d041c945ccca98283bc465d5a87c (patch) | |
tree | bae5a056d7f13d1422dc0ee2c511111b5b0c6d08 /spec/requests | |
parent | 618033fb2f0461275f03541f428e33b3e1b4d721 (diff) |
API: Expose Issue#user_notes_count
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index f88e39cad9e..008bcae1747 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -39,6 +39,7 @@ describe API::API, api: true do let!(:empty_milestone) do create(:milestone, title: '2.0.0', project: project) end + let!(:issue_note) { create(:note, noteable: issue, project: project, author: user) } before { project.team << [user, :reporter] } @@ -128,6 +129,13 @@ describe API::API, api: true do expect(json_response).to be_an Array expect(json_response.length).to eq(0) end + + it 'should return an count notes in issue' do + get api("/issues", user) + expect(response.status).to eq(200) + expect(json_response).to be_an Array + expect(json_response.first['user_notes_count']).to eq(1) + end end end @@ -229,6 +237,13 @@ describe API::API, api: true do expect(json_response.length).to eq(1) expect(json_response.first['id']).to eq(closed_issue.id) end + + it 'should return an count notes in issue' do + get api("#{base_url}/issues", user) + expect(response.status).to eq(200) + expect(json_response).to be_an Array + expect(json_response.first['user_notes_count']).to eq(1) + end end describe "GET /projects/:id/issues/:issue_id" do |