require 'spec_helper' RSpec.describe 'Sanitize rendering', type: :render do it 'parses sanitized script' do # Default in faml expect(render_string('&= "hello

unescape

world"')).to eq("hello<p>unescape</p>world\n") expect(render_string(<\nhello<p>unescape</p>world\n\n") %span &= "hello

unescape

world" HAML end it 'ignores single sanitize mark' do expect(render_string('&

hello

')).to eq("

hello

\n") expect(render_string('%span&

hello

')).to eq("

hello

\n") end it 'parses == syntax' do expect(render_string('&== =

hello

')).to eq("=

hello

\n") expect(render_string('%span&== =

hello

')).to eq("=

hello

\n") end context 'with preserve' do it 'ignores preserve mark' do expect(render_string('&~ "

hello

"')).to eq("<p>hello</p>\n") expect(render_string('%span&~ "

hello

"')).to eq("<p>hello</p>\n") end end end