# File test/javascript_helper_test.rb, line 6 def _evaluate_assigns_and_ivars() end
# File test/javascript_helper_test.rb, line 15 def setup super ActiveSupport.escape_html_entities_in_json = true @template = self end
# File test/javascript_helper_test.rb, line 21 def teardown ActiveSupport.escape_html_entities_in_json = false end
# File test/javascript_helper_test.rb, line 39 def test_link_to_function_with_inner_block_does_not_raise_exception html = link_to_function( "Greet me!" ) do |page| page.replace_html 'header', (content_tag :h1 do 'Greetings' end) end assert_dom_equal %Q(<a href="#" onclick="Element.update("header", "\\u003Ch1\\u003EGreetings\\u003C/h1\\u003E");; return false;">Greet me!</a>), html end
# File test/javascript_helper_test.rb, line 25 def test_link_to_function_with_rjs_block html = link_to_function( "Greet me!" ) do |page| page.replace_html 'header', "<h1>Greetings</h1>" end assert_dom_equal %Q(<a href="#" onclick="Element.update("header", "\\u003Ch1\\u003EGreetings\\u003C/h1\\u003E");; return false;">Greet me!</a>), html end
# File test/javascript_helper_test.rb, line 32 def test_link_to_function_with_rjs_block_and_options html = link_to_function( "Greet me!", :class => "updater" ) do |page| page.replace_html 'header', "<h1>Greetings</h1>" end assert_dom_equal %Q(<a href="#" class="updater" onclick="Element.update("header", "\\u003Ch1\\u003EGreetings\\u003C/h1\\u003E");; return false;">Greet me!</a>), html end
# File test/javascript_helper_test.rb, line 10 def update_details(details) @details = details yield if block_given? end