aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/javascript_helper_test.rb
diff options
context:
space:
mode:
authorRodrigo Dominguez <rorra@rorra.com.ar>2010-07-27 15:38:20 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-07-29 13:11:53 -0300
commitaa054c35f7809b57ecb105e485e4436d9fe37b1b (patch)
treea9d1597e959bfe8b8089b8316f4190818a528d87 /actionpack/test/template/javascript_helper_test.rb
parentd04c6f2ff6047fe03dae0ca162948befa246c7e4 (diff)
downloadrails-aa054c35f7809b57ecb105e485e4436d9fe37b1b.tar.gz
rails-aa054c35f7809b57ecb105e485e4436d9fe37b1b.tar.bz2
rails-aa054c35f7809b57ecb105e485e4436d9fe37b1b.zip
link_to_function now expects a piece of javascript code for the onclick parameter
[#5179] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack/test/template/javascript_helper_test.rb')
-rw-r--r--actionpack/test/template/javascript_helper_test.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb
index 1a899c6aee..a8ca19931b 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionpack/test/template/javascript_helper_test.rb
@@ -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(&quot;header&quot;, &quot;\\u003Ch1\\u003EGreetings\\u003C/h1\\u003E&quot;);; return false;">Greet me!</a>), html
end
def test_javascript_tag