From a1a41a3939318e9481469ea194660f3d8a9c1e66 Mon Sep 17 00:00:00 2001 From: Andrew Kaspick Date: Sat, 17 Jul 2010 17:25:08 -0500 Subject: remote_function patch with more detailed test Signed-off-by: wycats --- actionpack/test/template/prototype_helper_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index 0ff37f44c2..036a44730c 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -104,6 +104,12 @@ class PrototypeHelperTest < PrototypeHelperBaseTest assert_equal javascript_tag(create_generator(&block).to_s, {:defer => 'true'}), update_page_tag({:defer => 'true'}, &block) end + def test_remote_function + res = remote_function(:url => authors_path, :with => "'author[name]='+$F('author_name')+'&author[dob]='+$F('author_dob')") + assert_equal "new Ajax.Request('/authors', {asynchronous:true, evalScripts:true, parameters:'author[name]='+$F('author_name')+'&author[dob]='+$F('author_dob')})", res + assert res.html_safe? + end + protected def author_path(record) "/authors/#{record.id}" -- cgit v1.2.3