2017-05-09 12:14:24 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 14:24:02 +00:00
|
|
|
describe Banzai::Filter::AsciiDocPostProcessingFilter do
|
2017-05-09 12:14:24 +00:00
|
|
|
include FilterSpecHelper
|
|
|
|
|
|
|
|
it "adds class for elements with data-math-style" do
|
|
|
|
result = filter('<pre data-math-style="inline">some code</pre><div data-math>and</div>').to_html
|
|
|
|
expect(result).to eq('<pre data-math-style="inline" class="code math js-render-math">some code</pre><div data-math>and</div>')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "keeps content when no data-math-style found" do
|
|
|
|
result = filter('<pre>some code</pre><div data-math>and</div>').to_html
|
|
|
|
expect(result).to eq('<pre>some code</pre><div data-math>and</div>')
|
|
|
|
end
|
|
|
|
end
|