require 'helper' require 'erb' class TestSlimEmbeddedEngines < TestSlim def test_render_with_embedded_template source = %q{ p - text = 'before erb block' erb: Hello from <%= text.upcase %>! Second Line! <% if true %><%= true %><% end %> } assert_html "

Hello from BEFORE ERB BLOCK!\nSecond Line!\ntrue\n

", source end def test_render_with_interpolated_embedded_template source = %q{ markdown: #Header Hello from #{"Markdown!"} Second Line! } assert_html "

Header

\n\n

Hello from Markdown!\nSecond Line!

\n", source end def test_render_with_javascript source = %q{ javascript: $(function() {}); } assert_html '', source end def test_render_with_ruby source = %q{ ruby: variable = 1 + 2 = variable } assert_html '3', source end def test_render_with_liquid source = %q{ p - text = 'before liquid block' liquid: {{text}} } assert_html "

before liquid block\n

", source end end