summaryrefslogtreecommitdiff
path: root/spec/helpers/application_helper_spec.rb
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2015-05-13 01:54:13 +0200
committerJakub Jirutka <jakub@jirutka.cz>2015-05-18 22:52:13 +0200
commitb0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0 (patch)
tree54701d5d517061602ff5ac58512268f4c18a105a /spec/helpers/application_helper_spec.rb
parentdaa0925016a63dcde448643cbf1310aca359cf37 (diff)
downloadgitlab-ce-b0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0.tar.gz
Simplify and unify helpers for rendering markup
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-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')