mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
DEV: Improve video onebox stripping spec
Followup to 70819080
This commit is contained in:
parent
19dcc6bb7b
commit
7a09e2cce2
@ -796,10 +796,15 @@ describe PrettyText do
|
||||
<a href="http://videosource.com/running.mp4">http://videosource.com/running.mp4</a>
|
||||
</video>
|
||||
</div>
|
||||
<p>Watch this, but not in the excerpt.</p>
|
||||
<p>Watch this, but do not include the video in the excerpt.</p>
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user