diff options
author | Toon Claes <toon@gitlab.com> | 2017-05-30 23:06:38 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-05-31 11:12:39 +0300 |
commit | a52b54f3dae8a161050c31f45de900f4d59985e7 (patch) | |
tree | c548341d138d30672643fac4f3a83b7406964b3d /spec | |
parent | 3ea9de81f2789093317eb583364059414f1ab6bc (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.rb | 2 |
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 |