diff options
Diffstat (limited to 'spec/requests/api/users_spec.rb')
-rw-r--r-- | spec/requests/api/users_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index ee0f7545adc..864f6f77f39 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -280,6 +280,18 @@ describe API::Users, :do_not_mock_admin_mode do expect(json_response.first['id']).to eq(user_with_2fa.id) end + it "returns users without projects" do + user_without_projects = create(:user) + create(:project, namespace: user.namespace) + create(:project, namespace: admin.namespace) + + get api('/users', admin), params: { without_projects: true } + + expect(response).to match_response_schema('public_api/v4/user/admins') + expect(json_response.size).to eq(1) + expect(json_response.first['id']).to eq(user_without_projects.id) + end + it 'returns 400 when provided incorrect sort params' do get api('/users', admin), params: { order_by: 'magic', sort: 'asc' } |