Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 15:11:55 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 17:54:28 +0300
commitaee5691db3ec411c242e050aaa11ebb44f07f164 (patch)
tree1bacabb4632b3d90701729d32cbaf41ddeb51c14 /spec/finders/group_descendants_finder_spec.rb
parent3fe7f31ac047e1b9ba3ae53cea17012ce2f7f3e7 (diff)
Don't load unneeded elements in GroupsController#show
Diffstat (limited to 'spec/finders/group_descendants_finder_spec.rb')
-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)