spec/rumble_spec.rb in keynote-0.3.1 vs spec/rumble_spec.rb in keynote-1.0.0

- old
+ new

@@ -22,10 +22,11 @@ assert_equal exp, res assert_instance_of ActiveSupport::SafeBuffer, res end def setup + @rumble_context = nil super assert_nil @rumble_context end def teardown @@ -53,9 +54,37 @@ div.input do input type: 'text', name: 'value' end end + end + end + + def test_string_data + assert_rumble '<div data="whatever"></div>' do + div data: "whatever" + end + end + + def test_hash_data + str = <<-HTML + <div data-modal="true" data-safe="&quot;&quot;&quot;" data-unsafe="&quot;&amp;quot;&quot;"> + </div> + HTML + + assert_rumble str do + div data: { modal: true, safe: '"&quot;"'.html_safe, unsafe: '"&quot;"' } + end + end + + def test_array_attrs + str = <<-HTML + <div class="hello &quot;uns&amp;amp;fe&quot; &quot;w&amp;rld&quot;"> + </div> + HTML + + assert_rumble str do + div class: ["hello", '"uns&amp;fe"', '"w&amp;rld"'.html_safe] end end def test_several str = <<-HTML