mirror of
https://github.com/discourse/discourse.git
synced 2024-12-13 21:24:37 +08:00
21 lines
489 B
Ruby
21 lines
489 B
Ruby
require 'rails_helper'
|
|
require 'pretty_text'
|
|
|
|
describe PrettyText do
|
|
|
|
it "supports details tag" do
|
|
cooked_html = "<details><summary>foo</summary>bar</details>"
|
|
expect(PrettyText.cook("<details><summary>foo</summary>bar</details>")).to match_html(cooked_html)
|
|
|
|
cooked_html = <<~HTML
|
|
<details>
|
|
<summary>
|
|
foo</summary>
|
|
<p>bar</p>
|
|
</details>
|
|
HTML
|
|
expect(PrettyText.cook("[details=foo]\nbar\n[/details]")).to eq(cooked_html.strip)
|
|
end
|
|
|
|
end
|