Sha256: ed0eee0dc74e55fc421ec8a30a24ffee22a2be571d228d0581608ee929d0430e
Contents?: true
Size: 1.31 KB
Versions: 1
Compression:
Stored size: 1.31 KB
Contents
require 'helper' require 'erb' class TestSlimEmbeddedEngines < TestSlim def test_render_with_embedded_template source = %q{ p - text = 'before erb block' erb: <b>Hello from <%= text.upcase %>!</b> Second Line! <% if true %><%= true %><% end %> } assert_html "<p><b>Hello from BEFORE ERB BLOCK!</b>\nSecond Line!\ntrue\n</p>", source end def test_render_with_interpolated_embedded_template source = %q{ markdown: #Header Hello from #{"Markdown!"} "Second Line!" } assert_html "<h1>Header</h1>\n\n<p>Hello from Markdown!\n\"Second Line!\"</p>\n", source end def test_render_with_javascript # Keep the trailing space behind "javascript: "! source = %q{ javascript: $(function() {}); } assert_html '<script type="text/javascript">$(function() {});</script>', 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: <span>{{text}}</span> } assert_html "<p><span>before liquid block</span>\n</p>", source end def test_render_with_scss source = %q{ scss: $color: #f00; body { color: $color; } } assert_html "<style type=\"text/css\">body {\n color: red; }\n</style>", source end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
slim-0.7.3 | test/slim/test_embedded_engines.rb |