DEV: Add test.

Follow-up to bccd090cedd4f49b9a07958292baed462b8c1a1c.
This commit is contained in:
Bianca Nenciu 2019-06-26 16:37:01 +03:00
parent bccd090ced
commit 463db22928

View File

@ -41,4 +41,16 @@ describe PrettyText do
expect(md).to eq(html)
end
it 'escapes summary text' do
md = PrettyText.cook(<<~EOF)
<script>alert('hello')</script>
[details="<script>alert('hello')</script>"]
<script>alert('hello')</script>
[/details]
EOF
md = PrettyText.format_for_email(md, post)
expect(md).not_to include('<script>')
end
end