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

slack_markdown_sanitizer_spec.rb « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f4042439213ee9c2c228c193226d32cdf4862017 (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 SlackMarkdownSanitizer, feature_category: :integrations do
  describe '.sanitize' do
    using RSpec::Parameterized::TableSyntax

    where(:input, :output) do
      nil                              | nil
      ''                               | ''
      '[label](url)'                   | 'label(url)'
      '<url|label>'                    | 'urllabel'
      '<a href="url">label</a>'        | 'a href="url"label/a'
    end

    with_them do
      it 'returns the expected output' do
        expect(described_class.sanitize(input)).to eq(output)
      end
    end
  end
end