Welcome to mirror list, hosted at ThFree Co, Russian Federation.

html_entity_filter_spec.rb « filter « banzai « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6de3fa50a1a3639b24611b153f04ab3982229c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Banzai::Filter::HtmlEntityFilter, feature_category: :team_planning do
  include FilterSpecHelper

  let(:unescaped) { 'foo <strike attr="foo">&&amp;&</strike>' }
  let(:escaped) { 'foo &lt;strike attr=&quot;foo&quot;&gt;&amp;&amp;amp;&amp;&lt;/strike&gt;' }

  it 'converts common entities to their HTML-escaped equivalents' do
    output = filter(unescaped)

    expect(output).to eq(escaped)
  end
end