diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-12 12:50:39 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-12 12:50:39 +0300 |
commit | 1feb0894f73142c0127db86a3a84833d501e474f (patch) | |
tree | 8a3839cbc6d7000221fe81e4c5670d3d271dc2fd /spec | |
parent | 194c40df208526d5dc4401bc06f91d803def3740 (diff) | |
parent | 4ccd79983274442ca21e6c73ef0863097b57350c (diff) |
Merge branch '33003-avatar-in-project-api' into 'master'
Accept avatar file in project API
Closes #33003
See merge request !11988
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 9 |
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 |