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:
Andreas Nedbal 2022-01-10 22:48:03 +01:00 committed by Andreas Nedbal
parent e8d3b9629d
commit 515e6d09ff
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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