diff options
author | Stan Hu <stanhu@gmail.com> | 2015-12-11 23:17:36 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-12-11 23:17:36 -0800 |
commit | 3efae53bd79db118463bfaeceb209bc91f63bd0b (patch) | |
tree | 8cd4d83e4d395c223ce9a3105f0bcc13b271e2fd /spec/models | |
parent | 74dcbec369aca9dfa181c9a82e1978ba2396773a (diff) | |
download | gitlab-ce-3efae53bd79db118463bfaeceb209bc91f63bd0b.tar.gz |
Add open_issues_count to project API
This is needed to support Huboard and a generally useful value.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 6ddb0e2b8f7..37ac0495154 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -153,13 +153,17 @@ describe Project, models: true do describe '#get_issue' do let(:project) { create(:empty_project) } - let(:issue) { create(:issue, project: project) } + let!(:issue) { create(:issue, project: project) } context 'with default issues tracker' do it 'returns an issue' do expect(project.get_issue(issue.iid)).to eq issue end + it 'returns count of open issues' do + expect(project.open_issues_count).to eq(1) + end + it 'returns nil when no issue found' do expect(project.get_issue(999)).to be_nil end |