summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-04-21 10:17:19 -0500
committerToon Claes <toon@gitlab.com>2017-04-27 13:22:17 +0200
commit4f2d6b3e21911ab29ae18dff1be909d94f3127ed (patch)
treeea7186401f4b0fa02970c55f788b1dabeb2a247a /spec
parent05e0f504530a162d4bcb886adf504c12cffd5934 (diff)
downloadgitlab-ce-4f2d6b3e21911ab29ae18dff1be909d94f3127ed.tar.gz
Refactor MarkupHelper
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/markup_helper_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb
index 59ae6570ae7..bba4f4fdc8e 100644
--- a/spec/helpers/markup_helper_spec.rb
+++ b/spec/helpers/markup_helper_spec.rb
@@ -126,7 +126,7 @@ describe MarkupHelper do
it "uses Wiki pipeline for markdown files" do
allow(@wiki).to receive(:format).and_return(:markdown)
- expect(helper).to receive(:markdown_render).with('wiki content', pipeline: :wiki, project_wiki: @wiki, page_slug: "nested/page")
+ expect(helper).to receive(:markdown_unsafe).with('wiki content', pipeline: :wiki, project_wiki: @wiki, page_slug: "nested/page")
helper.render_wiki_content(@wiki)
end
@@ -135,7 +135,7 @@ describe MarkupHelper do
allow_any_instance_of(ApplicationSetting).to receive(:current).and_return(::ApplicationSetting.create_from_defaults)
allow(@wiki).to receive(:format).and_return(:asciidoc)
- expect(helper).to receive(:asciidoc_render).with('wiki content')
+ expect(helper).to receive(:asciidoc_unsafe).with('wiki content')
helper.render_wiki_content(@wiki)
end
@@ -150,26 +150,26 @@ describe MarkupHelper do
end
end
- describe 'render_markup' do
+ describe 'markup' do
let(:content) { 'Noël' }
it 'preserves encoding' do
expect(content.encoding.name).to eq('UTF-8')
- expect(helper.render_markup('foo.rst', content).encoding.name).to eq('UTF-8')
+ expect(helper.markup('foo.rst', content).encoding.name).to eq('UTF-8')
end
- it "delegates to #markdown_render when file name corresponds to Markdown" do
+ it "delegates to #markdown_unsafe when file name corresponds to Markdown" do
expect(helper).to receive(:gitlab_markdown?).with('foo.md').and_return(true)
- expect(helper).to receive(:markdown_render).and_return('NOEL')
+ expect(helper).to receive(:markdown_unsafe).and_return('NOEL')
- expect(helper.render_markup('foo.md', content)).to eq('NOEL')
+ expect(helper.markup('foo.md', content)).to eq('NOEL')
end
- it "delegates to #asciidoc_render when file name corresponds to AsciiDoc" do
+ it "delegates to #asciidoc_unsafe when file name corresponds to AsciiDoc" do
expect(helper).to receive(:asciidoc?).with('foo.adoc').and_return(true)
- expect(helper).to receive(:asciidoc_render).and_return('NOEL')
+ expect(helper).to receive(:asciidoc_unsafe).and_return('NOEL')
- expect(helper.render_markup('foo.adoc', content)).to eq('NOEL')
+ expect(helper.markup('foo.adoc', content)).to eq('NOEL')
end
end