Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-18 00:07:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-18 00:07:50 +0300
commit360ee1db0bf3bba2fc7aad7f230ec80829561227 (patch)
treeca7484ad394da3eb719c8070857e6f20eb1d9f51 /spec/services/markup/rendering_service_spec.rb
parentec76d14980534d45d25ef65134a756c733fe4877 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/markup/rendering_service_spec.rb')
-rw-r--r--spec/services/markup/rendering_service_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/services/markup/rendering_service_spec.rb b/spec/services/markup/rendering_service_spec.rb
index 99ab87f2072..ca70e983714 100644
--- a/spec/services/markup/rendering_service_spec.rb
+++ b/spec/services/markup/rendering_service_spec.rb
@@ -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