From 515e6d09ff1135fd5b5294454726adb7e5177267 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Mon, 10 Jan 2022 22:48:03 +0100 Subject: [PATCH] Use text ellipsis instead of three single dots for shortening Co-authored-by: Karina Kwiatek <6197148+raccube@users.noreply.github.com> --- app/helpers/application_helper/title_methods.rb | 2 +- spec/helpers/application_helper/title_methods_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper/title_methods.rb b/app/helpers/application_helper/title_methods.rb index 3eadb7e9..154800a3 100644 --- a/app/helpers/application_helper/title_methods.rb +++ b/app/helpers/application_helper/title_methods.rb @@ -18,7 +18,7 @@ module ApplicationHelper::TitleMethods unless content.nil? content = strip_markdown(content) if content.length > 45 - content = content[0..42] + "..." + content = content[0..42] + "…" end list.push content end diff --git a/spec/helpers/application_helper/title_methods_spec.rb b/spec/helpers/application_helper/title_methods_spec.rb index 6c680049..c9fc66cf 100644 --- a/spec/helpers/application_helper/title_methods_spec.rb +++ b/spec/helpers/application_helper/title_methods_spec.rb @@ -28,7 +28,7 @@ describe ApplicationHelper::TitleMethods, :type => :helper do end 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