diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-10 21:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-10 21:09:46 +0300 |
commit | 50ecbfaf1bfe883056ab366c8e4a28fd4574c6fa (patch) | |
tree | dc1034549eff45c7f057971da443aa1570bcebd3 /spec/finders | |
parent | aaabf6eb167d1a0bb2357f331bd411923ede37a6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/autocomplete/users_finder_spec.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/finders/autocomplete/users_finder_spec.rb b/spec/finders/autocomplete/users_finder_spec.rb index 319a1c20524..e4337e52306 100644 --- a/spec/finders/autocomplete/users_finder_spec.rb +++ b/spec/finders/autocomplete/users_finder_spec.rb @@ -88,13 +88,20 @@ RSpec.describe Autocomplete::UsersFinder do let(:parent) { create(:group, :public, parent: grandparent) } let(:child) { create(:group, :public, parent: parent) } let(:group) { parent } + let(:child_project) { create(:project, group: group) } let!(:grandparent_user) { create(:group_member, :developer, group: grandparent).user } let!(:parent_user) { create(:group_member, :developer, group: parent).user } let!(:child_user) { create(:group_member, :developer, group: child).user } - - it 'includes users from parent groups as well' do - expect(subject).to match_array([grandparent_user, parent_user]) + let!(:child_project_user) { create(:project_member, :developer, project: child_project).user } + + it 'includes users from parent groups, descendant groups, and descendant projects' do + expect(subject).to contain_exactly( + grandparent_user, + parent_user, + child_user, + child_project_user + ) end end |