diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-07-06 18:49:33 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-07-06 18:49:33 +0000 |
commit | 750af9fd32a050d1d2a8a7c5d014e5467de1e87a (patch) | |
tree | 51e5a6d23d6a34541de358c29cb552449c959ed3 /spec/features/snippets | |
parent | 9790fe58e590856e920877a935bfd22942787525 (diff) | |
download | gitlab-ce-750af9fd32a050d1d2a8a7c5d014e5467de1e87a.tar.gz |
Use proper markdown rendering for previews
Diffstat (limited to 'spec/features/snippets')
-rw-r--r-- | spec/features/snippets/show_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/features/snippets/show_spec.rb b/spec/features/snippets/show_spec.rb index 74b693f3eff..f31457db92f 100644 --- a/spec/features/snippets/show_spec.rb +++ b/spec/features/snippets/show_spec.rb @@ -68,6 +68,26 @@ describe 'Snippet', :js do end end + context 'with cached Redcarpet html' do + let(:snippet) { create(:personal_snippet, :public, file_name: file_name, content: content, cached_markdown_version: CacheMarkdownField::CACHE_REDCARPET_VERSION) } + let(:file_name) { 'test.md' } + let(:content) { "1. one\n - sublist\n" } + + it 'renders correctly' do + expect(page).to have_xpath("//ol//li//ul") + end + end + + context 'with cached CommonMark html' do + let(:snippet) { create(:personal_snippet, :public, file_name: file_name, content: content, cached_markdown_version: CacheMarkdownField::CACHE_COMMONMARK_VERSION) } + let(:file_name) { 'test.md' } + let(:content) { "1. one\n - sublist\n" } + + it 'renders correctly' do + expect(page).not_to have_xpath("//ol//li//ul") + end + end + context 'switching to the simple viewer' do before do find('.js-blob-viewer-switch-btn[data-viewer=simple]').click |