diff options
Diffstat (limited to 'spec/services/markup/rendering_service_spec.rb')
-rw-r--r-- | spec/services/markup/rendering_service_spec.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/services/markup/rendering_service_spec.rb b/spec/services/markup/rendering_service_spec.rb index 99ab87f2072..952ee33da98 100644 --- a/spec/services/markup/rendering_service_spec.rb +++ b/spec/services/markup/rendering_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Markup::RenderingService do +RSpec.describe Markup::RenderingService, feature_category: :projects do describe '#execute' do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) do @@ -111,5 +111,22 @@ RSpec.describe Markup::RenderingService do is_expected.to eq(expected_html) end end + + context 'with reStructuredText' do + let(:file_name) { 'foo.rst' } + let(:text) { "####\nPART\n####" } + + it 'returns rendered html' do + is_expected.to eq("<h1>PART</h1>\n\n") + end + + context 'when input has an invalid syntax' do + let(:text) { "####\nPART\n##" } + + it 'uses a simple formatter for html' do + is_expected.to eq("<p>####\n<br>PART\n<br>##</p>") + end + end + end end end |