summaryrefslogtreecommitdiff
path: root/spec/requests/api/issues_spec.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-04-10 10:25:59 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-04-10 10:25:59 +0000
commit33a4439e8f079303fcf7c71267936e5c8f694958 (patch)
tree828c3c6dc55058e95927d36a3a03db9fd0263766 /spec/requests/api/issues_spec.rb
parent2db218f8bf186c509c927ce3e9d0502fee4f8349 (diff)
parent174950b6562226beed7eef135a2450bfee60e21f (diff)
downloadgitlab-ce-33a4439e8f079303fcf7c71267936e5c8f694958.tar.gz
Merge branch 'master' into 'stuartnelson3/gitlab-ce-stn/issue-due-email'
# Conflicts: # db/schema.rb
Diffstat (limited to 'spec/requests/api/issues_spec.rb')
-rw-r--r--spec/requests/api/issues_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
index 6614e8cea43..90f9c4ad214 100644
--- a/spec/requests/api/issues_spec.rb
+++ b/spec/requests/api/issues_spec.rb
@@ -384,6 +384,30 @@ describe API::Issues do
end
let(:base_url) { "/groups/#{group.id}/issues" }
+ context 'when group has subgroups', :nested_groups do
+ let(:subgroup_1) { create(:group, parent: group) }
+ let(:subgroup_2) { create(:group, parent: subgroup_1) }
+
+ let(:subgroup_1_project) { create(:project, namespace: subgroup_1) }
+ let(:subgroup_2_project) { create(:project, namespace: subgroup_2) }
+
+ let!(:issue_1) { create(:issue, project: subgroup_1_project) }
+ let!(:issue_2) { create(:issue, project: subgroup_2_project) }
+
+ before do
+ group.add_developer(user)
+ end
+
+ it 'also returns subgroups projects issues' do
+ get api(base_url, user)
+
+ issue_ids = json_response.map { |issue| issue['id'] }
+
+ expect_paginated_array_response(size: 5)
+ expect(issue_ids).to include(issue_1.id, issue_2.id)
+ end
+ end
+
it 'returns all group issues (including opened and closed)' do
get api(base_url, admin)