summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2013-10-09 15:01:02 +0200
committerMarin Jankovski <maxlazio@gmail.com>2013-10-09 15:01:02 +0200
commit7dbbb6defeba71892230b20c5d1390f94ae1f719 (patch)
tree568f5b00c8ca4e5f419e9a1f72642dfe149f63b6 /spec
parent70f828cd4b06c0854e71b72cc03cf45c11987d7e (diff)
downloadgitlab-ce-7dbbb6defeba71892230b20c5d1390f94ae1f719.tar.gz
Rename method to avoid clashes.
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/gitlab_markdown_helper_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb
index d49247accc2..a0bbc026421 100644
--- a/spec/helpers/gitlab_markdown_helper_spec.rb
+++ b/spec/helpers/gitlab_markdown_helper_spec.rb
@@ -406,6 +406,30 @@ describe GitlabMarkdownHelper do
it "should generate absolute urls for emoji" do
markdown(":smile:").should include("src=\"#{url_to_image("emoji/smile")}")
end
+
+ it "should handle relative urls for a file in master" do
+ actual = "[GitLab API doc](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 for a directory in master" do
+ actual = "[GitLab API doc](doc/api)\n"
+ expected = "<p><a href=\"/#{project.path_with_namespace}/tree/master/doc/api\">GitLab API doc</a></p>\n"
+ markdown(actual).should match(expected)
+ end
+
+ it "should handle absolute urls" do
+ actual = "[GitLab](https://www.gitlab.com)\n"
+ expected = "<p><a href=\"https://www.gitlab.com\">GitLab</a></p>\n"
+ markdown(actual).should match(expected)
+ end
+
+ it "should handle wiki urls" do
+ actual = "[Link](test/link)\n"
+ expected = "<p><a href=\"/#{project.path_with_namespace}/wikis/test/link\">Link</a></p>\n"
+ markdown(actual).should match(expected)
+ end
end
describe "#render_wiki_content" do