summaryrefslogtreecommitdiff
path: root/spec/helpers/application_helper_spec.rb
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2015-05-13 01:07:48 +0200
committerJakub Jirutka <jakub@jirutka.cz>2015-05-18 20:48:03 +0200
commit8dbc4746fe7c723b67f3c90cbf40fd7bf6c29cb7 (patch)
tree268aba3884c8e2e09fdefda9cad7a4c569154cc2 /spec/helpers/application_helper_spec.rb
parentdc348baf18240dc05e209ec781daada2cbcfe16f (diff)
downloadgitlab-ce-8dbc4746fe7c723b67f3c90cbf40fd7bf6c29cb7.tar.gz
Handle AsciiDoc better, reuse HTML pipeline filters (fixes #9263)
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r--spec/helpers/application_helper_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index d4cf6540080..59870dfb192 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -261,12 +261,19 @@ describe ApplicationHelper do
end
end
- describe 'markup_render' do
+ describe 'render_markup' do
let(:content) { 'Noël' }
it 'should preserve encoding' do
expect(content.encoding.name).to eq('UTF-8')
expect(render_markup('foo.rst', content).encoding.name).to eq('UTF-8')
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')
+
+ expect(render_markup('foo.adoc', content)).to eq('NOEL')
+ end
end
end