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
091b1c5e
Unverified
Commit
091b1c5e
authored
Sep 07, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary args from `link_to_member_avatar` method in `app/helpers/projects_helper.rb`
parent
9151ca7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
projects_helper.rb
app/helpers/projects_helper.rb
+1
-3
projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+4
-6
No files found.
app/helpers/projects_helper.rb
View file @
091b1c5e
...
...
@@ -15,11 +15,9 @@ module ProjectsHelper
end
def
link_to_member_avatar
(
author
,
opts
=
{})
default_opts
=
{
avatar:
true
,
name:
true
,
size:
16
,
author_class:
'author'
,
title:
":name"
}
default_opts
=
{
size:
16
}
opts
=
default_opts
.
merge
(
opts
)
return
unless
opts
[
:avatar
]
classes
=
%W[avatar avatar-inline s
#{
opts
[
:size
]
}
]
classes
<<
opts
[
:avatar_class
]
if
opts
[
:avatar_class
]
...
...
spec/helpers/projects_helper_spec.rb
View file @
091b1c5e
...
...
@@ -195,23 +195,21 @@ describe ProjectsHelper do
let
(
:user
)
{
build_stubbed
(
:user
)
}
let
(
:expected
)
{
double
}
it
'returns image tag for member avatar'
do
before
do
expect
(
helper
).
to
receive
(
:avatar_icon
).
with
(
user
,
16
).
and_return
(
expected
)
end
it
'returns image tag for member avatar'
do
expect
(
helper
).
to
receive
(
:image_tag
).
with
(
expected
,
{
width:
16
,
class:
[
"avatar"
,
"avatar-inline"
,
"s16"
],
alt:
""
})
helper
.
link_to_member_avatar
(
user
)
end
it
'returns image tag with avatar class'
do
expect
(
helper
).
to
receive
(
:avatar_icon
).
with
(
user
,
16
).
and_return
(
expected
)
expect
(
helper
).
to
receive
(
:image_tag
).
with
(
expected
,
{
width:
16
,
class:
[
"avatar"
,
"avatar-inline"
,
"s16"
,
"any-avatar-class"
],
alt:
""
})
helper
.
link_to_member_avatar
(
user
,
avatar_class:
"any-avatar-class"
)
end
it
'returns no image tag if avatar is nil'
do
expect
(
helper
.
link_to_member_avatar
(
user
,
avatar:
nil
)).
to
eq
(
nil
)
end
end
describe
'#link_to_member'
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