diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-07-06 21:49:33 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-07-06 21:49:33 +0300 |
commit | 750af9fd32a050d1d2a8a7c5d014e5467de1e87a (patch) | |
tree | 51e5a6d23d6a34541de358c29cb552449c959ed3 /spec/models | |
parent | 9790fe58e590856e920877a935bfd22942787525 (diff) |
Use proper markdown rendering for previews
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/concerns/cache_markdown_field_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/concerns/cache_markdown_field_spec.rb b/spec/models/concerns/cache_markdown_field_spec.rb index 2d75422ee68..da26d802688 100644 --- a/spec/models/concerns/cache_markdown_field_spec.rb +++ b/spec/models/concerns/cache_markdown_field_spec.rb @@ -370,4 +370,20 @@ describe CacheMarkdownField do end end end + + describe CacheMarkdownField::MarkdownEngine do + subject { lambda { |version| CacheMarkdownField::MarkdownEngine.from_version(version) } } + + it 'returns :common_mark as a default' do + expect(subject.call(nil)).to eq :common_mark + end + + it 'returns :common_mark' do + expect(subject.call(CacheMarkdownField::CACHE_COMMONMARK_VERSION)).to eq :common_mark + end + + it 'returns :redcarpet' do + expect(subject.call(CacheMarkdownField::CACHE_REDCARPET_VERSION)).to eq :redcarpet + end + end end |