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:
Diffstat (limited to 'spec/lib/banzai/pipeline/wiki_pipeline_spec.rb')
-rw-r--r--spec/lib/banzai/pipeline/wiki_pipeline_spec.rb19
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb b/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
index 007d310247b..59f5e4a6900 100644
--- a/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
+++ b/spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
@@ -27,7 +27,7 @@ RSpec.describe Banzai::Pipeline::WikiPipeline do
end
end
- it 'is case-sensitive' do
+ it 'is not case-sensitive' do
markdown = <<-MD.strip_heredoc
[[_toc_]]
@@ -36,9 +36,22 @@ RSpec.describe Banzai::Pipeline::WikiPipeline do
Foo
MD
- output = described_class.to_html(markdown, project: project, wiki: wiki)
+ result = described_class.call(markdown, project: project, wiki: wiki)
+
+ expect(result[:output].to_html).to include(result[:toc])
+ end
+
+ it 'works with alternative [toc] tag' do
+ markdown = <<-MD.strip_heredoc
+ [toc]
- expect(output).to include('[[<em>toc</em>]]')
+ # Header 1
+
+ Foo
+ MD
+
+ result = described_class.call(markdown, project: project, wiki: wiki)
+ expect(result[:output].to_html).to include(result[:toc])
end
it 'handles an empty pipeline result' do