2016-07-07 01:46:47 +08:00
|
|
|
require 'rails_helper'
|
|
|
|
require 'pretty_text'
|
|
|
|
|
|
|
|
describe PrettyText do
|
|
|
|
|
|
|
|
it "supports details tag" do
|
2017-07-19 02:44:49 +08:00
|
|
|
cooked_html = "<details><summary>foo</summary>bar</details>"
|
2016-07-07 01:46:47 +08:00
|
|
|
expect(PrettyText.cook("<details><summary>foo</summary>bar</details>")).to match_html(cooked_html)
|
2017-07-19 02:44:49 +08:00
|
|
|
|
|
|
|
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)
|
2016-07-07 01:46:47 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|