blob: 5f971372dcc87cd9f25775e4f6fb75388cd90624 (
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
27
28
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Banzai::Filter::JiraImport::AdfToCommonmarkFilter, feature_category: :team_planning do
include FilterSpecHelper
let_it_be(:fixtures_path) { 'lib/kramdown/atlassian_document_format' }
it 'renders a complex document' do
source = fixture_file(File.join(fixtures_path, 'complex_document.json'))
target = fixture_file(File.join(fixtures_path, 'complex_document.md'))
expect(filter(source)).to eq target
end
it 'renders original source when it is invalid JSON' do
source = fixture_file(File.join(fixtures_path, 'invalid_json.json'))
expect(filter(source)).to eq "Invalid Atlassian Document Format JSON\n\n#{source}"
end
it 'renders original source when missing document node' do
source = fixture_file(File.join(fixtures_path, 'invalid_no_doc.json'))
expect(filter(source)).to eq "Invalid Atlassian Document Format JSON\n\n#{source}"
end
end
|