discourse/spec/components/import/normalize_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
607 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "rails_helper"
describe Import::Normalize do
describe "#normalize_code_blocks" do
it "normalizes 2 code blocks correctly" do
markdown = <<MD
&nbsp;
<pre>
<code>
I am a te&nbsp;&quot;
</code></pre>
test &nbsp;
<pre><code>this is a &quot;&quot;</code></pre>
MD
expected = " &nbsp;\n \n```\n I am a te \"\n \n```\n\n test &nbsp;\n \n```\nthis is a \"\"\n```\n\n"
2015-01-09 11:34:37 -05:00
expect(Import::Normalize.normalize_code_blocks(markdown)).to eq(expected)
end
end
end