BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c4cf7220
Commit
c4cf7220
authored
Feb 09, 2018
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove generic #avatar_icon helper.
parent
c641dff0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
36 deletions
+0
-36
application_helper.rb
app/helpers/application_helper.rb
+0
-8
application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+0
-28
No files found.
app/helpers/application_helper.rb
View file @
c4cf7220
...
@@ -68,14 +68,6 @@ module ApplicationHelper
...
@@ -68,14 +68,6 @@ module ApplicationHelper
end
end
end
end
def
avatar_icon
(
user_or_email
=
nil
,
size
=
nil
,
scale
=
2
,
only_path:
true
)
if
user_or_email
.
is_a?
(
User
)
avatar_icon_for_user
(
user_or_email
,
size
,
scale
,
only_path:
only_path
)
else
avatar_icon_for_email
(
user_or_email
,
size
,
scale
,
only_path:
only_path
)
end
end
def
avatar_icon_for_email
(
email
=
nil
,
size
=
nil
,
scale
=
2
,
only_path:
true
)
def
avatar_icon_for_email
(
email
=
nil
,
size
=
nil
,
scale
=
2
,
only_path:
true
)
user
=
User
.
find_by_any_email
(
email
.
try
(
:downcase
))
user
=
User
.
find_by_any_email
(
email
.
try
(
:downcase
))
if
user
if
user
...
...
spec/helpers/application_helper_spec.rb
View file @
c4cf7220
...
@@ -63,34 +63,6 @@ describe ApplicationHelper do
...
@@ -63,34 +63,6 @@ describe ApplicationHelper do
end
end
end
end
describe
'avatar_icon'
do
let
(
:user
)
{
create
(
:user
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
}
context
'using an email'
do
context
'when there is a matching user'
do
it
'returns a relative URL for the avatar'
do
expect
(
helper
.
avatar_icon
(
user
.
email
).
to_s
)
.
to
eq
(
user
.
avatar
.
url
)
end
end
context
'when no user exists for the email'
do
it
'calls gravatar_icon'
do
expect
(
helper
).
to
receive
(
:gravatar_icon
).
with
(
'foo@example.com'
,
20
,
2
)
helper
.
avatar_icon
(
'foo@example.com'
,
20
,
2
)
end
end
end
describe
'using a user'
do
it
'returns a relative URL for the avatar'
do
expect
(
helper
.
avatar_icon
(
user
).
to_s
)
.
to
eq
(
user
.
avatar
.
url
)
end
end
end
describe
'avatar_icon_for_email'
do
describe
'avatar_icon_for_email'
do
let
(
:user
)
{
create
(
:user
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
}
let
(
:user
)
{
create
(
:user
,
avatar:
File
.
open
(
uploaded_image_temp_path
))
}
...
...
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