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
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2015-05-13 02:54:13 +0300
committerJakub Jirutka <jakub@jirutka.cz>2015-05-18 23:52:13 +0300
commitb0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0 (patch)
tree54701d5d517061602ff5ac58512268f4c18a105a /spec/helpers
parentdaa0925016a63dcde448643cbf1310aca359cf37 (diff)
Simplify and unify helpers for rendering markup
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/application_helper_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 59870dfb192..3307ac776fc 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -269,6 +269,13 @@ describe ApplicationHelper do
expect(render_markup('foo.rst', content).encoding.name).to eq('UTF-8')
end
+ it "should delegate to #markdown when file name corresponds to Markdown" do
+ expect(self).to receive(:gitlab_markdown?).with('foo.md').and_return(true)
+ expect(self).to receive(:markdown).and_return('NOEL')
+
+ expect(render_markup('foo.md', content)).to eq('NOEL')
+ end
+
it "should delegate to #asciidoc when file name corresponds to AsciiDoc" do
expect(self).to receive(:asciidoc?).with('foo.adoc').and_return(true)
expect(self).to receive(:asciidoc).and_return('NOEL')