diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-12-17 16:30:49 +0300 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2019-03-14 20:21:02 +0300 |
commit | db0cf709703f0cc344351d2a8fd28d7d51046296 (patch) | |
tree | c43fc1b4fcc72537f4688a5f07ad3932c254bf91 /spec/lib/gitlab/group_search_results_spec.rb | |
parent | 3b01d23af0a17e269bbd39eab0d54b55d9b84b3e (diff) |
restrict user result set by the scoped group
Diffstat (limited to 'spec/lib/gitlab/group_search_results_spec.rb')
-rw-r--r-- | spec/lib/gitlab/group_search_results_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/group_search_results_spec.rb b/spec/lib/gitlab/group_search_results_spec.rb index 02245ca88dc..2734fcef0a0 100644 --- a/spec/lib/gitlab/group_search_results_spec.rb +++ b/spec/lib/gitlab/group_search_results_spec.rb @@ -55,5 +55,15 @@ describe Gitlab::GroupSearchResults do expect(result).to eq [] end + + it 'does not return the user belonging to an unrelated group' do + user = create(:user, username: 'gob_bluth') + unrelated_group = create(:group) + create(:group_member, :developer, user: user, group: unrelated_group) + + result = described_class.new(user, anything, group, 'gob').objects('users') + + expect(result).to eq [] + end end end |