diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:17 +0300 |
commit | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (patch) | |
tree | f1096c68e457aef7f5201acd16e4a751ff538026 /spec/requests/api/users_spec.rb | |
parent | 18f7828977b74bf6e5153594a098ef90e773b3b7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/users_spec.rb')
-rw-r--r-- | spec/requests/api/users_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 4a89069cbec..7d63a031666 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -330,6 +330,14 @@ describe API::Users, :do_not_mock_admin_mode do expect(json_response.keys).not_to include 'last_sign_in_ip' end + it "does not contain plan or trial data" do + get api("/users/#{user.id}", user) + + expect(response).to match_response_schema('public_api/v4/user/basic') + expect(json_response.keys).not_to include 'plan' + expect(json_response.keys).not_to include 'trial' + end + context 'when job title is present' do let(:job_title) { 'Fullstack Engineer' } @@ -367,6 +375,22 @@ describe API::Users, :do_not_mock_admin_mode do expect(json_response['highest_role']).to be(0) end + if Gitlab.ee? + it 'does not include values for plan or trial' do + get api("/users/#{user.id}", admin) + + expect(response).to match_response_schema('public_api/v4/user/basic') + end + else + it 'does not include plan or trial data' do + get api("/users/#{user.id}", admin) + + expect(response).to match_response_schema('public_api/v4/user/basic') + expect(json_response.keys).not_to include 'plan' + expect(json_response.keys).not_to include 'trial' + end + end + context 'when user has not logged in' do it 'does not include the sign in IPs' do get api("/users/#{user.id}", admin) |