summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-09-21 15:10:33 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-09-26 19:14:19 +0100
commitd70b7a490dae32435c5c906bc6f923676c52a9ea (patch)
tree47e317492536a2da0edccdf5fa12a55407a7115f /spec/requests
parent4d88f6496836c7fbf8a0f58e4d2604bf2c3f96d5 (diff)
downloadgitlab-ce-d70b7a490dae32435c5c906bc6f923676c52a9ea.tar.gz
find_user users helper method no longer overrides find_user API helper method.37467-helper-method-from-users-endpoint-overrides-api-helper-method
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/users_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 5b306ec6cbf..c30188b1b41 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -125,6 +125,15 @@ describe API::Users do
end
context "when admin" do
+ context 'when sudo is defined' do
+ it 'does not return 500' do
+ admin_personal_access_token = create(:personal_access_token, user: admin).token
+ get api("/users?private_token=#{admin_personal_access_token}&sudo=#{user.id}", admin)
+
+ expect(response).to have_http_status(:success)
+ end
+ end
+
it "returns an array of users" do
get api("/users", admin)