Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDan Knox <dknox@threedotloft.com>2013-03-14 10:31:08 +0400
committerDan Knox <dknox@threedotloft.com>2013-03-14 10:31:08 +0400
commit7665b1de7eed4addd7b94786c84e6674710e6377 (patch)
tree289d9115420059d0afe0bba968d1840cc642cd31 /spec
parentf0aa54e0fbce27600aa02a1ee5465e2ab5c18ccc (diff)
Use Gitlab Markdown for Markdown files and Gollum to render the rest.
This commit enables the usage of the Gitlab Markdown post processing on all Markdown formatted files. For file types that do not contain Markdown, it defaults to the Gollum native renderer to process the content.
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 1f5fabfbb8e..ac49e4d6da0 100644
--- a/spec/helpers/gitlab_markdown_helper_spec.rb
+++ b/spec/helpers/gitlab_markdown_helper_spec.rb
@@ -363,4 +363,28 @@ describe GitlabMarkdownHelper do
markdown(":smile:").should include("src=\"#{url_to_image("emoji/smile")}")
end
end
+
+ describe "#render_wiki_content" do
+ before do
+ @wiki = stub('WikiPage')
+ @wiki.stub(:content).and_return('wiki content')
+ end
+
+ it "should use Gitlab Flavored Markdown for markdown files" do
+ @wiki.stub(:format).and_return(:markdown)
+
+ helper.should_receive(:markdown).with('wiki content')
+
+ helper.render_wiki_content(@wiki)
+ end
+
+ it "should use the Gollum renderer for all other file types" do
+ @wiki.stub(:format).and_return(:rdoc)
+ formatted_content_stub = stub('formatted_content')
+ formatted_content_stub.should_receive(:html_safe)
+ @wiki.stub(:formatted_content).and_return(formatted_content_stub)
+
+ helper.render_wiki_content(@wiki)
+ end
+ end
end