summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-08-16 15:11:30 +0100
committerHimanshu Kapoor <hkapoor@gitlab.com>2019-08-19 14:21:56 +0530
commitf7f91e84f71afa6bcf8a22ed181ce719bfbaf35c (patch)
treed1b3c63affba9c4349b23d2244fddb05cf5912cc /spec
parentbbf639c43d689bd63a32ef7a60bdf83d3bd329bf (diff)
downloadgitlab-ce-f7f91e84f71afa6bcf8a22ed181ce719bfbaf35c.tar.gz
Add a skip_users filter to the project users API
This functionality is available in the /autocomplete users pseudo-API. We're attempting to replace that with the canonical API, so it needs support for this parameter too.
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/projects_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 1d7ca85cdd2..5465fe0c366 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -1494,6 +1494,17 @@ describe API::Projects do
expect(response).to have_gitlab_http_status(404)
end
+
+ it 'filters out users listed in skip_users' do
+ other_user = create(:user)
+ project.team.add_developer(other_user)
+
+ get api("/projects/#{project.id}/users?skip_users=#{user.id}", user)
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(json_response.size).to eq(1)
+ expect(json_response[0]['id']).to eq(other_user.id)
+ end
end
end