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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
462161a3
Commit
462161a3
authored
Jan 23, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Markdown helper spec for reference style relative links.
parent
16ba8fa0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+18
-0
No files found.
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
462161a3
...
...
@@ -431,6 +431,24 @@ describe GitlabMarkdownHelper do
expected
=
"<p><a href=
\"
/
#{
project
.
path_with_namespace
}
/wikis/test/link
\"
>Link</a></p>
\n
"
markdown
(
actual
).
should
match
(
expected
)
end
it
"should handle relative urls in reference links for a file in master"
do
actual
=
"[GitLab API doc][GitLab readme]
\n
[GitLab readme]: doc/api/README.md
\n
"
expected
=
"<p><a href=
\"
/
#{
project
.
path_with_namespace
}
/blob/master/doc/api/README.md
\"
>GitLab API doc</a></p>
\n
"
markdown
(
actual
).
should
match
(
expected
)
end
it
"should handle relative urls in reference links for a directory in master"
do
actual
=
"[GitLab API doc directory][GitLab readmes]
\n
[GitLab readmes]: doc/api/
\n
"
expected
=
"<p><a href=
\"
/
#{
project
.
path_with_namespace
}
/tree/master/doc/api/
\"
>GitLab API doc directory</a></p>
\n
"
markdown
(
actual
).
should
match
(
expected
)
end
it
"should not handle malformed relative urls in reference links for a file in master"
do
actual
=
"[GitLab readme]: doc/api/README.md
\n
"
expected
=
""
markdown
(
actual
).
should
match
(
expected
)
end
end
describe
"#render_wiki_content"
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