test that wiki links with spaces works in wiki pipeline
This commit is contained in:
parent
5a7451c2f9
commit
e41b999432
|
@ -121,6 +121,13 @@ describe Banzai::Pipeline::WikiPipeline do
|
|||
expect(output).to include("href=\"#{relative_url_root}/wiki_link_ns/wiki_link_project/wikis/page\"")
|
||||
end
|
||||
|
||||
it 'rewrites non-file links (with spaces) to be at the scope of the wiki root' do
|
||||
markdown = "[Link to Page](page slug)"
|
||||
output = described_class.to_html(markdown, project: project, project_wiki: project_wiki, page_slug: page.slug)
|
||||
|
||||
expect(output).to include("href=\"#{relative_url_root}/wiki_link_ns/wiki_link_project/wikis/page%20slug\"")
|
||||
end
|
||||
|
||||
it "rewrites file links to be at the scope of the current directory" do
|
||||
markdown = "[Link to Page](page.md)"
|
||||
output = described_class.to_html(markdown, project: project, project_wiki: project_wiki, page_slug: page.slug)
|
||||
|
@ -134,6 +141,13 @@ describe Banzai::Pipeline::WikiPipeline do
|
|||
|
||||
expect(output).to include("href=\"#{relative_url_root}/wiki_link_ns/wiki_link_project/wikis/start-page#title\"")
|
||||
end
|
||||
|
||||
it 'rewrites links (with spaces) with anchor' do
|
||||
markdown = '[Link to Header](start page#title)'
|
||||
output = described_class.to_html(markdown, project: project, project_wiki: project_wiki, page_slug: page.slug)
|
||||
|
||||
expect(output).to include("href=\"#{relative_url_root}/wiki_link_ns/wiki_link_project/wikis/start%20page#title\"")
|
||||
end
|
||||
end
|
||||
|
||||
describe "when creating root links" do
|
||||
|
|
Loading…
Reference in New Issue