Sha256: 096de3ef6d84b89620e2eef7f1064925636d874d76b0ec217e472702294f2ce9
Contents?: true
Size: 1.03 KB
Versions: 13
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' RSpec.describe 'Sanitize rendering', type: :render do it 'parses sanitized script' do # Default in faml expect(render_string('&= "hello<p>unescape</p>world"')).to eq("hello<p>unescape</p>world\n") expect(render_string(<<HAML)).to eq("<span>\nhello<p>unescape</p>world\n</span>\n") %span &= "hello<p>unescape</p>world" HAML end it 'ignores single sanitize mark' do expect(render_string('& <p>hello</p>')).to eq("<p>hello</p>\n") expect(render_string('%span& <p>hello</p>')).to eq("<span><p>hello</p></span>\n") end it 'parses == syntax' do expect(render_string('&== =<p>hello</p>')).to eq("=<p>hello</p>\n") expect(render_string('%span&== =<p>hello</p>')).to eq("<span>=<p>hello</p></span>\n") end context 'with preserve' do it 'ignores preserve mark' do expect(render_string('&~ "<p>hello</p>"')).to eq("<p>hello</p>\n") expect(render_string('%span&~ "<p>hello</p>"')).to eq("<span><p>hello</p></span>\n") end end end
Version data entries
13 entries across 13 versions & 1 rubygems