diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/finders/users_finder_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/finders/users_finder_spec.rb')
-rw-r--r-- | spec/finders/users_finder_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/finders/users_finder_spec.rb b/spec/finders/users_finder_spec.rb index 7f1fc1cc1c5..17b36247b05 100644 --- a/spec/finders/users_finder_spec.rb +++ b/spec/finders/users_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe UsersFinder do +RSpec.describe UsersFinder do describe '#execute' do include_context 'UsersFinder#execute filter by project context' @@ -21,6 +21,12 @@ describe UsersFinder do expect(users).to contain_exactly(normal_user) end + it 'filters by id' do + users = described_class.new(user, id: normal_user.id).execute + + expect(users).to contain_exactly(normal_user) + end + it 'filters by username (case insensitive)' do users = described_class.new(user, username: 'joHNdoE').execute @@ -70,6 +76,12 @@ describe UsersFinder do expect(users).to contain_exactly(user, normal_user, blocked_user, omniauth_user) end + + it 'orders returned results' do + users = described_class.new(user, sort: 'id_asc').execute + + expect(users).to eq([normal_user, blocked_user, omniauth_user, user]) + end end context 'with an admin user' do |