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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
ff8f7fb0
Commit
ff8f7fb0
authored
Oct 12, 2015
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-use User for avatars in link_to_member
parent
94963563
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
spec/helpers/projects_helper_spec.rb
spec/helpers/projects_helper_spec.rb
+14
-0
No files found.
app/helpers/projects_helper.rb
View file @
ff8f7fb0
...
...
@@ -29,7 +29,7 @@ module ProjectsHelper
author_html
=
""
# Build avatar image tag
author_html
<<
image_tag
(
avatar_icon
(
author
.
try
(
:email
)
,
opts
[
:size
]),
width:
opts
[
:size
],
class:
"avatar avatar-inline
#{
"s
#{
opts
[
:size
]
}
"
if
opts
[
:size
]
}
"
,
alt
:''
)
if
opts
[
:avatar
]
author_html
<<
image_tag
(
avatar_icon
(
author
,
opts
[
:size
]),
width:
opts
[
:size
],
class:
"avatar avatar-inline
#{
"s
#{
opts
[
:size
]
}
"
if
opts
[
:size
]
}
"
,
alt
:''
)
if
opts
[
:avatar
]
# Build name span tag
author_html
<<
content_tag
(
:span
,
sanitize
(
author
.
name
),
class:
opts
[
:author_class
])
if
opts
[
:name
]
...
...
spec/helpers/projects_helper_spec.rb
View file @
ff8f7fb0
...
...
@@ -70,4 +70,18 @@ describe ProjectsHelper do
expect
(
helper
.
send
(
:readme_cache_key
)).
to
eq
(
"
#{
project
.
path_with_namespace
}
-nil-readme"
)
end
end
describe
'link_to_member'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:empty_project
,
group:
group
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'using the default options'
do
it
'returns an HTML link to the user'
do
link
=
helper
.
link_to_member
(
project
,
user
)
expect
(
link
).
to
match
(
%r{/u/
#{
user
.
username
}
}
)
end
end
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