debian-mirror-gitlab/spec/lib/banzai/filter/markdown_filter_spec.rb
2017-09-10 17:25:29 +05:30

19 lines
491 B
Ruby

require 'spec_helper'
describe Banzai::Filter::MarkdownFilter do
include FilterSpecHelper
context 'code block' do
it 'adds language to lang attribute when specified' do
result = filter("```html\nsome code\n```")
expect(result).to start_with("\n<pre><code lang=\"html\">")
end
it 'does not add language to lang attribute when not specified' do
result = filter("```\nsome code\n```")
expect(result).to start_with("\n<pre><code>")
end
end
end