class JavaScriptHelperTest

Attributes

formats[RW]
output_buffer[RW]

Public Instance Methods

_evaluate_assigns_and_ivars() click to toggle source
# File test/javascript_helper_test.rb, line 6
def _evaluate_assigns_and_ivars() end
setup() click to toggle source
# File test/javascript_helper_test.rb, line 15
def setup
  super
  ActiveSupport.escape_html_entities_in_json  = true
  @template = self
end
teardown() click to toggle source
# File test/javascript_helper_test.rb, line 21
def teardown
  ActiveSupport.escape_html_entities_in_json  = false
end
test_button_to_function_with_rjs_block() click to toggle source
# File test/javascript_helper_test.rb, line 48
def test_button_to_function_with_rjs_block
  html = button_to_function( "Greet me!" ) do |page|
    page.replace_html 'header', "<h1>Greetings</h1>"
  end
  assert_dom_equal %Q(<input type="button" onclick="Element.update(&quot;header&quot;, &quot;\\u003Ch1\\u003EGreetings\\u003C/h1\\u003E&quot;);;" value="Greet me!" />), html
end
test_button_to_function_with_rjs_block_and_options() click to toggle source
# File test/javascript_helper_test.rb, line 55
def test_button_to_function_with_rjs_block_and_options
  html = button_to_function( "Greet me!", :class => "greeter" ) do |page|
    page.replace_html 'header', "<h1>Greetings</h1>"
  end
  assert_dom_equal %Q(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;\\u003Ch1\\u003EGreetings\\u003C\/h1\\u003E&quot;);;" value="Greet me!" />), html
end
update_details(details) { || ... } click to toggle source
# File test/javascript_helper_test.rb, line 10
def update_details(details)
  @details = details
  yield if block_given?
end