2016-04-27 21:38:33 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-07-10 14:24:02 +00:00
|
|
|
describe Banzai::Filter::BlockquoteFenceFilter do
|
2016-04-27 21:38:33 +00:00
|
|
|
include FilterSpecHelper
|
|
|
|
|
2016-07-10 19:59:36 +00:00
|
|
|
it 'converts blockquote fences to blockquote lines' do
|
2016-04-27 21:38:33 +00:00
|
|
|
content = File.read(Rails.root.join('spec/fixtures/blockquote_fence_before.md'))
|
|
|
|
expected = File.read(Rails.root.join('spec/fixtures/blockquote_fence_after.md'))
|
|
|
|
|
|
|
|
output = filter(content)
|
|
|
|
|
|
|
|
expect(output).to eq(expected)
|
|
|
|
end
|
2018-06-18 11:28:21 +00:00
|
|
|
|
|
|
|
it 'allows trailing whitespace on blockquote fence lines' do
|
2019-04-03 13:42:23 +00:00
|
|
|
expect(filter(">>> \ntest\n>>> ")).to eq("\n> test\n")
|
2018-06-18 11:28:21 +00:00
|
|
|
end
|
2016-04-27 21:38:33 +00:00
|
|
|
end
|