diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-19 13:41:00 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-19 13:41:00 +0300 |
commit | 2923a0c8fede436fd407b76537fee963a13ac3ea (patch) | |
tree | fb86cda63b24e5b0c2bdeebf36986e50202e90b5 /spec/requests/api | |
parent | a4a5cbf29a983d05b5fc69f8e63fc37e100c8637 (diff) | |
parent | 83a9a472b3bd9c9d8e64805317cd27c144b65112 (diff) |
Merge branch '26212-upload-user-avatar-trough-api' into 'master'
Accept image for avatar in user API
Closes #26212
See merge request !12143
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/users_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 9dc4b6972a6..bc869ea1108 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -377,6 +377,16 @@ describe API::Users do expect(user.reload.organization).to eq('GitLab') end + it 'updates user with avatar' do + put api("/users/#{user.id}", admin), { avatar: fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') } + + user.reload + + expect(user.avatar).to be_present + expect(response).to have_http_status(200) + expect(json_response['avatar_url']).to include(user.avatar_path) + end + it 'updates user with his own email' do put api("/users/#{user.id}", admin), email: user.email expect(response).to have_http_status(200) |