2019-09-04 21:01:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'fast_spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::MarkdownCache::FieldData do
|
2019-09-04 21:01:54 +05:30
|
|
|
subject(:field_data) { described_class.new }
|
|
|
|
|
|
|
|
before do
|
|
|
|
field_data[:description] = { project: double('project in context') }
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'translates a markdown field name into a html field name' do
|
|
|
|
expect(field_data.html_field(:description)).to eq("description_html")
|
|
|
|
end
|
2021-09-04 01:27:46 +05:30
|
|
|
|
|
|
|
describe '#key?' do
|
|
|
|
specify do
|
|
|
|
expect(field_data.key?(:description)).to be_truthy
|
|
|
|
expect(field_data.key?(:something_else)).to be_falsy
|
|
|
|
end
|
|
|
|
end
|
2019-09-04 21:01:54 +05:30
|
|
|
end
|