Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e41b9994
Commit
e41b9994
authored
Aug 17, 2018
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test that wiki links with spaces works in wiki pipeline
parent
5a7451c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
+14
-0
No files found.
spec/lib/banzai/pipeline/wiki_pipeline_spec.rb
View file @
e41b9994
...
@@ -121,6 +121,13 @@ describe Banzai::Pipeline::WikiPipeline do
...
@@ -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
\"
"
)
expect
(
output
).
to
include
(
"href=
\"
#{
relative_url_root
}
/wiki_link_ns/wiki_link_project/wikis/page
\"
"
)
end
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
it
"rewrites file links to be at the scope of the current directory"
do
markdown
=
"[Link to Page](page.md)"
markdown
=
"[Link to Page](page.md)"
output
=
described_class
.
to_html
(
markdown
,
project:
project
,
project_wiki:
project_wiki
,
page_slug:
page
.
slug
)
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
...
@@ -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
\"
"
)
expect
(
output
).
to
include
(
"href=
\"
#{
relative_url_root
}
/wiki_link_ns/wiki_link_project/wikis/start-page#title
\"
"
)
end
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
end
describe
"when creating root links"
do
describe
"when creating root links"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment