summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-09-06 15:28:07 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-04 22:46:49 +0200
commit9f3995a0ca3d56fd8d219a2b01c3e6555fd91f27 (patch)
treecd09cb13db43b06b11be915f98a271f549288358 /spec
parent28c440045ed001ab6029131ab7c842b390f4e186 (diff)
downloadgitlab-ce-9f3995a0ca3d56fd8d219a2b01c3e6555fd91f27.tar.gz
Find all children matching a query
Diffstat (limited to 'spec')
-rw-r--r--spec/finders/group_children_finder_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/finders/group_children_finder_spec.rb b/spec/finders/group_children_finder_spec.rb
index a2a24b2a12e..8f83f88bb97 100644
--- a/spec/finders/group_children_finder_spec.rb
+++ b/spec/finders/group_children_finder_spec.rb
@@ -47,6 +47,20 @@ describe GroupChildrenFinder do
expect(finder.execute).to contain_exactly(matching_subgroup, matching_project)
end
+
+ context 'with matching children' do
+ it 'includes a group that has a subgroup matching the query' do
+ matching_subgroup = create(:group, name: 'testgroup', parent: subgroup)
+
+ expect(finder.execute).to contain_exactly(matching_subgroup)
+ end
+
+ it 'includes a group that has a project matching the query' do
+ matching_project = create(:project, namespace: subgroup, name: 'Testproject')
+
+ expect(finder.execute).to contain_exactly(matching_project)
+ end
+ end
end
end