Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
38d407d7
Commit
38d407d7
authored
Jul 09, 2018
by
Jamie Schembri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #48537 - Update avatar only via the projects API
parent
a0935bf2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
changelogs/unreleased/48537-update-avatar-only-via-api.yml
changelogs/unreleased/48537-update-avatar-only-via-api.yml
+5
-0
lib/api/projects.rb
lib/api/projects.rb
+2
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+14
-0
No files found.
changelogs/unreleased/48537-update-avatar-only-via-api.yml
0 → 100644
View file @
38d407d7
---
title
:
Allow updating a project's avatar without other params
merge_request
:
author
:
Jamie Schembri
type
:
fixed
lib/api/projects.rb
View file @
38d407d7
...
...
@@ -260,7 +260,8 @@ module API
:snippets_enabled
,
:tag_list
,
:visibility
,
:wiki_enabled
:wiki_enabled
,
:avatar
]
optional
:name
,
type:
String
,
desc:
'The name of the project'
optional
:default_branch
,
type:
String
,
desc:
'The default branch of the project'
...
...
spec/requests/api/projects_spec.rb
View file @
38d407d7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment