2015-10-11 04:41:23 -05:00
|
|
|
|
require "rails_helper"
|
2014-06-05 19:34:21 -05:00
|
|
|
|
require_dependency "import/normalize"
|
|
|
|
|
|
|
|
|
|
describe Import::Normalize do
|
|
|
|
|
describe "#normalize_code_blocks" do
|
|
|
|
|
it "normalizes 2 code blocks correctly" do
|
|
|
|
|
markdown = <<MD
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
<code>
|
|
|
|
|
I am a te "
|
|
|
|
|
</code></pre>
|
|
|
|
|
test
|
|
|
|
|
<pre><code>this is a ""</code></pre>
|
|
|
|
|
MD
|
|
|
|
|
expected = " \n \n```\n I am a te \"\n \n```\n\n test \n \n```\nthis is a \"\"\n```\n\n"
|
2015-01-09 10:34:37 -06:00
|
|
|
|
expect(Import::Normalize.normalize_code_blocks(markdown)).to eq(expected)
|
2014-06-05 19:34:21 -05:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|