Sam Saffron 30990006a9 DEV: enable frozen string literal on all files
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00

29 lines
662 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
require 'pretty_text'
describe PrettyText do
it "supports details tag" do
cooked_html = <<~HTML
<details>
<summary>
foo</summary>
<p>bar</p>
</details>
HTML
expect(cooked_html).to match_html(cooked_html)
expect(PrettyText.cook("[details=foo]\nbar\n[/details]")).to match_html(cooked_html)
end
it "deletes elided content" do
cooked_html = PrettyText.cook("Hello World\n\n<details class='elided'>42</details>")
mail_html = PrettyText.cook("Hello World")
expect(PrettyText.format_for_email(cooked_html)).to match_html(mail_html)
end
end