Use text ellipsis instead of three single dots for shortening
Co-authored-by: Karina Kwiatek <6197148+raccube@users.noreply.github.com>
This commit is contained in:
parent
e8d3b9629d
commit
515e6d09ff
|
@ -18,7 +18,7 @@ module ApplicationHelper::TitleMethods
|
||||||
unless content.nil?
|
unless content.nil?
|
||||||
content = strip_markdown(content)
|
content = strip_markdown(content)
|
||||||
if content.length > 45
|
if content.length > 45
|
||||||
content = content[0..42] + "..."
|
content = content[0..42] + "…"
|
||||||
end
|
end
|
||||||
list.push content
|
list.push content
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,7 @@ describe ApplicationHelper::TitleMethods, :type => :helper do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should cut content that is too long' do
|
it 'should cut content that is too long' do
|
||||||
expect(generate_title('A title', 'with', 'a' * 50)).to eq('A title with aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... | Waschmaschine')
|
expect(generate_title('A title', 'with', 'a' * 50)).to eq('A title with aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa… | Waschmaschine')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue