test/slim/test_embedded_engines.rb in slim-1.0.3 vs test/slim/test_embedded_engines.rb in slim-1.0.4
- old
+ new
@@ -25,10 +25,16 @@
* one
* two
}
assert_html "<h1 id=\"header\">Header</h1>\n<p>Hello from Markdown!</p>\n\n<p>3</p>\n\n<ul>\n <li>one</li>\n <li>two</li>\n</ul>\n", source
+
+ Slim::EmbeddedEngine.default_options[:markdown] = {:auto_ids => false}
+ assert_html "<h1>Header</h1>\n<p>Hello from Markdown!</p>\n\n<p>3</p>\n\n<ul>\n <li>one</li>\n <li>two</li>\n</ul>\n", source
+ Slim::EmbeddedEngine.default_options[:markdown] = nil
+
+ assert_html "<h1 id=\"header\">Header</h1>\n<p>Hello from Markdown!</p>\n\n<p>3</p>\n\n<ul>\n <li>one</li>\n <li>two</li>\n</ul>\n", source
end
def test_render_with_creole
source = %q{
creole:
@@ -36,10 +42,20 @@
== head2
}
assert_html "<h1>head1</h1><h2>head2</h2>", source
end
+ def test_render_with_builder
+ source = %q{
+builder:
+ xml.p(:id => 'test') {
+ xml.text!('Hello')
+ }
+}
+ assert_html "<p id=\"test\">\nHello</p>\n", source
+ end
+
def test_render_with_wiki
source = %q{
wiki:
= head1
== head2
@@ -56,9 +72,15 @@
alert('hello')
p Hi
}
assert_html %{<script type="text/javascript">$(function() {});\n\n\nalert('hello')</script><p>Hi</p>}, source
+ end
+
+ def test_render_with_javascript_with_tabs
+ # Keep the trailing space behind "javascript: "!
+ source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
+ assert_html "<script type=\"text/javascript\">$(function() {});\nalert('hello')</script><p>Hi</p>", source
end
def test_render_with_javascript_including_variable
# Keep the trailing space behind "javascript: "!
source = %q{