summaryrefslogtreecommitdiff
path: root/spec/support/banzai/reference_filter_shared_examples.rb
blob: eb5da662ab5f9c26aee739fcf971337ee818476b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Specs for reference links containing HTML.
#
# Requires a reference:
#   let(:reference) { '#42' }
shared_examples 'a reference containing an element node' do
  let(:inner_html) { 'element <code>node</code> inside' }
  let(:reference_with_element) { %{<a href="#{reference}">#{inner_html}</a>} }

  it 'does not escape inner html' do
    doc = reference_filter(reference_with_element)
    expect(doc.children.first.inner_html).to eq(inner_html)
  end
end