2021-03-11 19:13:27 +05:30
|
|
|
# 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)'
|
2021-04-17 20:07:23 +05:30
|
|
|
:tier | %w(gold premium) | ' `gold`, `premium`'
|
|
|
|
:distribution | %w(ce ee) | ' `ce`, `ee`'
|
2021-03-11 19:13:27 +05:30
|
|
|
:key_path | 'key.path' | '**`key.path`**'
|
|
|
|
:milestone | '13.4' | '13.4'
|
2021-04-17 20:07:23 +05:30
|
|
|
:status | 'data_available' | '`data_available`'
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
with_them do
|
|
|
|
subject { described_class.format(key, value) }
|
|
|
|
|
|
|
|
it { is_expected.to eq(expected_value) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|