diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-17 01:41:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-17 01:41:27 +0300 |
commit | a84fa039e5dafa3ce7cde0869683ed2fdf5a38a4 (patch) | |
tree | 840c361422cf4dd1d5aa3246d47ac440783d715a /spec/requests | |
parent | 899da2d359848b005984373052b2e697fd5d10f2 (diff) |
Add latest changes from gitlab-org/gitlab@16-6-stable-ee
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/users_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 76fe72efc64..b73ae2d33eb 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -238,6 +238,22 @@ RSpec.describe API::Users, :aggregate_failures, feature_category: :user_profile expect(json_response.first['username']).to eq('a-user') expect(json_response.second['username']).to eq('a-user2') end + + it 'preserves requested ordering with order_by and sort' do + get api(path, user, admin_mode: true), params: { search: first_user.username, order_by: 'name', sort: 'desc' } + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response.first['username']).to eq('a-user2') + expect(json_response.second['username']).to eq('a-user') + end + + it 'preserves requested ordering with sort' do + get api(path, user, admin_mode: true), params: { search: first_user.username, sort: 'desc' } + + expect(response).to have_gitlab_http_status(:ok) + expect(json_response.first['username']).to eq('a-user2') + expect(json_response.second['username']).to eq('a-user') + end end context 'N+1 queries' do |