summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/usage/docs/value_formatter_spec.rb
blob: f21656df89435f2138f188f1844ffa53c4cdf717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Usage::Docs::ValueFormatter do
  describe '.format' do
    using RSpec::Parameterized::TableSyntax
    where(:key, :value, :expected_value) do
      :product_group     | 'growth::product intelligence' | '`growth::product intelligence`'
      :data_source       | 'redis'                        | 'Redis'
      :data_source       | 'ruby'                         | 'Ruby'
      :introduced_by_url | 'http://test.com'              | '[Introduced by](http://test.com)'
      :tier              | %w(gold premium)               | ' `gold`, `premium`'
      :distribution      | %w(ce ee)                      | ' `ce`, `ee`'
      :key_path          | 'key.path'                     | '**`key.path`**'
      :milestone         | '13.4'                         | '13.4'
      :status            | 'data_available'               | '`data_available`'
    end

    with_them do
      subject { described_class.format(key, value) }

      it { is_expected.to eq(expected_value) }
    end
  end
end