DEV: Add test.

Follow-up to bccd090ced.
This commit is contained in:
Bianca Nenciu 2019-06-26 16:37:01 +03:00
parent bccd090ced
commit 463db22928
1 changed files with 12 additions and 0 deletions

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