diff options
author | Rémy Coutable <remy@rymai.me> | 2017-07-12 13:18:14 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-12 13:45:46 +0300 |
commit | 91f63820a540e7f3e7206dc8044e257cf28527dc (patch) | |
tree | cb00077df90431ce561d6314a4542cb3a7aa988b /spec/requests/api/users_spec.rb | |
parent | dc05bcd885e441e8cac0e5038141bca0775f049d (diff) |
Return `is_admin` attribute in the GET /user endpoint for admins
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/requests/api/users_spec.rb')
-rw-r--r-- | spec/requests/api/users_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index a2368c9d996..877bde3b9a6 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -943,11 +943,11 @@ describe API::Users do expect(response).to have_http_status(403) end - it 'returns initial current user without private token when sudo not defined' do + it 'returns initial current user without private token but with is_admin when sudo not defined' do get api("/user?private_token=#{admin_personal_access_token}") expect(response).to have_http_status(200) - expect(response).to match_response_schema('public_api/v4/user/public') + expect(response).to match_response_schema('public_api/v4/user/admin') expect(json_response['id']).to eq(admin.id) end end @@ -961,11 +961,11 @@ describe API::Users do expect(json_response['id']).to eq(user.id) end - it 'returns initial current user without private token when sudo not defined' do + it 'returns initial current user without private token but with is_admin when sudo not defined' do get api("/user?private_token=#{admin.private_token}") expect(response).to have_http_status(200) - expect(response).to match_response_schema('public_api/v4/user/public') + expect(response).to match_response_schema('public_api/v4/user/admin') expect(json_response['id']).to eq(admin.id) end end |