summaryrefslogtreecommitdiff
path: root/spec/requests/api/users_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 09:07:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-03 09:07:54 +0000
commit87ef501eacd66d7166183d20d84e33de022f7002 (patch)
treefa4e0f41e00a4b6aeb035530be4b5473f51b7a3d /spec/requests/api/users_spec.rb
parentf321e51f46bcb628c3e96a44b5ebf3bb1c4033ab (diff)
downloadgitlab-ce-87ef501eacd66d7166183d20d84e33de022f7002.tar.gz
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.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 5a302f0528e..73bdd3b5d96 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -330,6 +330,21 @@ describe API::Users, :do_not_mock_admin_mode do
expect(json_response.keys).not_to include 'last_sign_in_ip'
end
+ context 'when job title is present' do
+ let(:job_title) { 'Fullstack Engineer' }
+
+ before do
+ create(:user_detail, user: user, job_title: job_title)
+ end
+
+ it 'returns job title of a user' do
+ get api("/users/#{user.id}", user)
+
+ expect(response).to match_response_schema('public_api/v4/user/basic')
+ expect(json_response['job_title']).to eq(job_title)
+ end
+ end
+
context 'when authenticated as admin' do
it 'includes the `is_admin` field' do
get api("/users/#{user.id}", admin)