Sha256: 80c726dc038e483f6a13a2d7c00290a2ffcefd3adc72d3bf8e6826fed179a399
Contents?: true
Size: 1.29 KB
Versions: 55
Compression:
Stored size: 1.29 KB
Contents
require 'helper' class TestSlimHtmlEscaping < TestSlim def test_html_will_not_be_escaped source = %q{ p <Hello> World, meet "Slim". } assert_html '<p><Hello> World, meet "Slim".</p>', source end def test_html_with_newline_will_not_be_escaped source = %q{ p | <Hello> World, meet "Slim". } assert_html "<p><Hello> World,\n meet \"Slim\".</p>", source end def test_html_with_escaped_interpolation source = %q{ - x = '"' - content = '<x>' p class="#{x}" test #{content} } assert_html '<p class=""">test <x></p>', source end def test_html_nested_escaping source = %q{ = hello_world do | escaped & } assert_html 'Hello World from @env escaped & Hello World from @env', source end def test_html_quoted_attr_escape source = %q{ p id="&" class=="&" } assert_html '<p class="&" id="&"></p>', source end def test_html_quoted_attr_escape_with_interpolation source = %q{ p id="&#{'"'}" class=="&#{'"'}" p id="&#{{'"'}}" class=="&#{{'"'}}" } assert_html '<p class="&"" id="&""></p><p class="&"" id="&""></p>', source end def test_html_ruby_attr_escape source = %q{ p id=('&'.to_s) class==('&'.to_s) } assert_html '<p class="&" id="&"></p>', source end end
Version data entries
55 entries across 55 versions & 5 rubygems