From 7a09e2cce22fe5e6af3e38c0be34f67499de3ff6 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Thu, 20 Feb 2020 11:44:54 -0500 Subject: [PATCH] DEV: Improve video onebox stripping spec Followup to 70819080 --- spec/components/pretty_text_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index f2ab77be420..784b607972a 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -796,10 +796,15 @@ describe PrettyText do http://videosource.com/running.mp4 -

Watch this, but not in the excerpt.

+

Watch this, but do not include the video in the excerpt.

HTML - expect(PrettyText.excerpt(html, 100)).to eq("Watch this, but not in the excerpt.") + ellipsis = "…" + excerpt_size = 40 + excerpt = PrettyText.excerpt(html, excerpt_size) + + expect(excerpt.size).to eq(excerpt_size + ellipsis.size) + expect(excerpt).to eq("Watch this, but do not include the video#{ellipsis}") end end