summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJamie Schembri <jamie@schembri.me>2018-07-09 17:44:09 +0200
committerJamie Schembri <jamie@schembri.me>2018-07-09 19:03:44 +0200
commit38d407d7a7fd07888cbfda26360cd0a1c4972ec5 (patch)
tree8bfdf191403241d215cea6168a87fbdba2e20827 /spec
parenta0935bf267b18c14a120809acd56a794c73121e3 (diff)
downloadgitlab-ce-38d407d7a7fd07888cbfda26360cd0a1c4972ec5.tar.gz
Fix #48537 - Update avatar only via the projects API
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/projects_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index de540ba7a10..15da81b57db 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -1526,6 +1526,20 @@ describe API::Projects do
expect(response).to have_gitlab_http_status(400)
end
+
+ it 'updates avatar' do
+ project_param = {
+ avatar: fixture_file_upload('spec/fixtures/banana_sample.gif',
+ 'image/gif')
+ }
+
+ put api("/projects/#{project3.id}", user), project_param
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(json_response['avatar_url']).to eq('http://localhost/uploads/'\
+ '-/system/project/avatar/'\
+ "#{project3.id}/banana_sample.gif")
+ end
end
context 'when authenticated as project master' do