DEV: improve spec to specify all code block formats

Previously we only covered a few, this covers a few more formats.
This commit is contained in:
Sam Saffron 2019-06-12 18:33:49 +10:00
parent 89c4332ac1
commit 739696fdf0

View File

@ -60,11 +60,21 @@ RSpec.describe InlineUploads do
end
it "should not correct code blocks" do
md = "`<a class=\"attachment\" href=\"#{upload2.url}\">In Code Block</a>`"
expect(InlineUploads.process(md)).to eq(md)
md = <<~MD
`<a class=\"attachment\" href=\"#{upload2.url}\">In Code Block</a>`
md = " <a class=\"attachment\" href=\"#{upload2.url}\">In Code Block</a>"
<a class=\"attachment\" href=\"#{upload2.url}\">In Code Block</a>
```
<a class=\"attachment\" href=\"#{upload2.url}\">In Code Block</a>
```
a [code]<a class=\"attachment\" href=\"#{upload2.url}\">In Code Block</a>[/code] b
[code]
<a class=\"attachment\" href=\"#{upload2.url}\">In Code Block</a>
[/code]
MD
expect(InlineUploads.process(md)).to eq(md)
end