mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
link_to_function now expects a piece of javascript code for the onclick parameter
[#5179] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
parent
d04c6f2ff6
commit
aa054c35f7
1 changed files with 5 additions and 4 deletions
|
@ -90,11 +90,12 @@ class JavaScriptHelperTest < ActionView::TestCase
|
|||
end
|
||||
|
||||
def test_link_to_function_with_inner_block_does_not_raise_exception
|
||||
html = link_to_function("Greet me!") do |page|
|
||||
content_tag(:h1) { 'Hi' }
|
||||
html = link_to_function( "Greet me!" ) do |page|
|
||||
page.replace_html 'header', (content_tag :h1 do
|
||||
'Greetings'
|
||||
end)
|
||||
end
|
||||
|
||||
assert_dom_equal %(<a href='#' onclick="; return false;">Greet me!</a>), html
|
||||
assert_dom_equal %(<a href="#" onclick="Element.update("header", "\\u003Ch1\\u003EGreetings\\u003C/h1\\u003E");; return false;">Greet me!</a>), html
|
||||
end
|
||||
|
||||
def test_javascript_tag
|
||||
|
|
Loading…
Reference in a new issue