Commit 61fe0a23 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Fixed WikiPipeline and specs

parent 28266d9d
......@@ -4,7 +4,7 @@ module Banzai
def self.filters
@filters ||= begin
super.insert_after(Filter::TableOfContentsFilter, Filter::GollumTagsFilter)
.insert_after(Filter::GollumTagsFilter, Filter::WikiLinkFilter)
.insert_after(Filter::TableOfContentsFilter, Filter::WikiLinkFilter)
end
end
end
......
require 'rails_helper'
describe Banzai::Pipeline::WikiPipeline do
let(:project_wiki) { double }
before(:each) { allow(project_wiki).to receive(:wiki_base_path) { '/some/repo/wikis' } }
describe 'TableOfContents' do
it 'replaces the tag with the TableOfContentsFilter result' do
markdown = <<-MD.strip_heredoc
......@@ -11,7 +14,7 @@ describe Banzai::Pipeline::WikiPipeline do
Foo
MD
result = described_class.call(markdown, project: spy, project_wiki: double)
result = described_class.call(markdown, project: spy, project_wiki: project_wiki)
aggregate_failures do
expect(result[:output].text).not_to include '[['
......@@ -29,7 +32,7 @@ describe Banzai::Pipeline::WikiPipeline do
Foo
MD
output = described_class.to_html(markdown, project: spy, project_wiki: double)
output = described_class.to_html(markdown, project: spy, project_wiki: project_wiki)
expect(output).to include('[[<em>toc</em>]]')
end
......@@ -42,7 +45,7 @@ describe Banzai::Pipeline::WikiPipeline do
Foo
MD
output = described_class.to_html(markdown, project: spy, project_wiki: double)
output = described_class.to_html(markdown, project: spy, project_wiki: project_wiki)
aggregate_failures do
expect(output).not_to include('<ul>')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment