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

emoji_pipeline_spec.rb « pipeline « banzai « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6ecd7f56dec9a6f861756fffb6d7c4ca5e28a1f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Banzai::Pipeline::EmojiPipeline, feature_category: :team_planning do
  let(:emoji) { TanukiEmoji.find_by_alpha_code('100') }

  def parse(text)
    described_class.to_html(text, {})
  end

  it 'replaces emoji' do
    expected_result = "Hello world #{Gitlab::Emoji.gl_emoji_tag(emoji)}"

    expect(parse('Hello world :100:')).to eq(expected_result)
  end

  it 'filters out HTML tags' do
    expected_result = "Hello <b>world</b> #{Gitlab::Emoji.gl_emoji_tag(emoji)}"

    expect(parse('Hello <b>world</b> :100:')).to eq(expected_result)
  end
end