diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2015-05-13 01:54:13 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2015-05-18 22:52:13 +0200 |
commit | b0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0 (patch) | |
tree | 54701d5d517061602ff5ac58512268f4c18a105a /spec/helpers | |
parent | daa0925016a63dcde448643cbf1310aca359cf37 (diff) | |
download | gitlab-ce-b0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0.tar.gz |
Simplify and unify helpers for rendering markup
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 7 |
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') |