summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorvanadium23 <chernoffivan@gmail.com>2017-06-09 22:49:57 +0300
committervanadium23 <chernoffivan@gmail.com>2017-06-09 22:49:57 +0300
commit4ccd79983274442ca21e6c73ef0863097b57350c (patch)
treef46ad6f3e9a06142bc97018c19fc2960ce2f79c9 /spec/requests
parent34dcfae994e23b7a65f2245817757e29f3f3e795 (diff)
downloadgitlab-ce-4ccd79983274442ca21e6c73ef0863097b57350c.tar.gz
Accept image for avatar in project API
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 86c57204971..3e831373514 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -398,6 +398,15 @@ describe API::Projects do
expect(json_response['tag_list']).to eq(%w[tagFirst tagSecond])
end
+ it 'uploads avatar for project a project' do
+ project = attributes_for(:project, avatar: fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif'))
+
+ post api('/projects', user), project
+
+ project_id = json_response['id']
+ expect(json_response['avatar_url']).to eq("http://localhost/uploads/system/project/avatar/#{project_id}/banana_sample.gif")
+ end
+
it 'sets a project as allowing merge even if build fails' do
project = attributes_for(:project, { only_allow_merge_if_pipeline_succeeds: false })
post api('/projects', user), project