summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 14:11:55 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 16:54:28 +0200
commitaee5691db3ec411c242e050aaa11ebb44f07f164 (patch)
tree1bacabb4632b3d90701729d32cbaf41ddeb51c14 /spec/finders
parent3fe7f31ac047e1b9ba3ae53cea17012ce2f7f3e7 (diff)
downloadgitlab-ce-aee5691db3ec411c242e050aaa11ebb44f07f164.tar.gz
Don't load unneeded elements in GroupsController#show
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/group_descendants_finder_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/finders/group_descendants_finder_spec.rb b/spec/finders/group_descendants_finder_spec.rb
index 1aef49613ee..4a5bdd84508 100644
--- a/spec/finders/group_descendants_finder_spec.rb
+++ b/spec/finders/group_descendants_finder_spec.rb
@@ -12,6 +12,22 @@ describe GroupDescendantsFinder do
group.add_owner(user)
end
+ describe '#has_children?' do
+ it 'is true when there are projects' do
+ create(:project, namespace: group)
+
+ expect(finder.has_children?).to be_truthy
+ end
+
+ context 'when there are subgroups', :nested_groups do
+ it 'is true when there are projects' do
+ create(:group, parent: group)
+
+ expect(finder.has_children?).to be_truthy
+ end
+ end
+ end
+
describe '#execute' do
it 'includes projects' do
project = create(:project, namespace: group)