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
57eb1ef6
Commit
57eb1ef6
authored
Mar 11, 2018
by
Fabian Schneider
Committed by
Sean McGivern
Mar 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change avatar error message to include allowed file formats
parent
2e8135d0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
4 deletions
+9
-4
app/models/concerns/avatarable.rb
app/models/concerns/avatarable.rb
+1
-1
changelogs/unreleased/43771-improve-avatar-error-message.yml
changelogs/unreleased/43771-improve-avatar-error-message.yml
+5
-0
spec/models/group_spec.rb
spec/models/group_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+1
-1
No files found.
app/models/concerns/avatarable.rb
View file @
57eb1ef6
...
...
@@ -22,7 +22,7 @@ module Avatarable
def
avatar_type
unless
self
.
avatar
.
image?
self
.
errors
.
add
:avatar
,
"only images allowed
"
errors
.
add
:avatar
,
"file format is not supported. Please try one of the following supported formats:
#{
AvatarUploader
::
IMAGE_EXT
.
join
(
', '
)
}
"
end
end
...
...
changelogs/unreleased/43771-improve-avatar-error-message.yml
0 → 100644
View file @
57eb1ef6
---
title
:
Change avatar error message to include allowed file formats
merge_request
:
17747
author
:
Fabian Schneider
type
:
changed
spec/models/group_spec.rb
View file @
57eb1ef6
...
...
@@ -241,7 +241,7 @@ describe Group do
it
"is false if avatar is html page"
do
group
.
update_attribute
(
:avatar
,
'uploads/avatar.html'
)
expect
(
group
.
avatar_type
).
to
eq
([
"
only images allowed
"
])
expect
(
group
.
avatar_type
).
to
eq
([
"
file format is not supported. Please try one of the following supported formats: png, jpg, jpeg, gif, bmp, tiff
"
])
end
end
...
...
spec/models/project_spec.rb
View file @
57eb1ef6
...
...
@@ -1055,7 +1055,7 @@ describe Project do
it
'is false if avatar is html page'
do
project
.
update_attribute
(
:avatar
,
'uploads/avatar.html'
)
expect
(
project
.
avatar_type
).
to
eq
([
'
only images allowed
'
])
expect
(
project
.
avatar_type
).
to
eq
([
'
file format is not supported. Please try one of the following supported formats: png, jpg, jpeg, gif, bmp, tiff
'
])
end
end
...
...
spec/models/user_spec.rb
View file @
57eb1ef6
...
...
@@ -1250,7 +1250,7 @@ describe User do
it
'is false if avatar is html page'
do
user
.
update_attribute
(
:avatar
,
'uploads/avatar.html'
)
expect
(
user
.
avatar_type
).
to
eq
([
'
only images allowed
'
])
expect
(
user
.
avatar_type
).
to
eq
([
'
file format is not supported. Please try one of the following supported formats: png, jpg, jpeg, gif, bmp, tiff
'
])
end
end
...
...
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