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
path: root/spec
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-05-30 23:06:38 +0300
committerToon Claes <toon@gitlab.com>2017-05-31 11:12:39 +0300
commita52b54f3dae8a161050c31f45de900f4d59985e7 (patch)
treec548341d138d30672643fac4f3a83b7406964b3d /spec
parent3ea9de81f2789093317eb583364059414f1ab6bc (diff)
Optimize query for User#groups_through_project_authorizations
Instead of plucking paths, and doing LIKE/OR on each of them, use a subquery to find groups that are the ancestor of the projects the user is member of.
Diffstat (limited to 'spec')
-rw-r--r--spec/finders/groups_finder_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb
index 31f1f753d4d..e082631ce68 100644
--- a/spec/finders/groups_finder_spec.rb
+++ b/spec/finders/groups_finder_spec.rb
@@ -91,7 +91,7 @@ describe GroupsFinder do
subsubproject = create(:empty_project, :private, namespace: private_subsubgroup)
subsubproject.add_guest(user)
- is_expected.to include(private_subsubgroup)
+ expect(described_class.new(user).execute).to include(private_subsubgroup, private_subgroup, parent_group)
end
end
end