aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/javascript_helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-12-31 03:50:08 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-12-31 03:50:08 +0000
commit341d34cd50ab1d807a9d515058d1da8fe75deb01 (patch)
tree157be187ddfeb78f3bef7bec0ef161b98ae35d5a /actionpack/test/template/javascript_helper_test.rb
parent00541f263b0aac16cdfcef68b4af5b1877f4dd02 (diff)
downloadrails-341d34cd50ab1d807a9d515058d1da8fe75deb01.tar.gz
rails-341d34cd50ab1d807a9d515058d1da8fe75deb01.tar.bz2
rails-341d34cd50ab1d807a9d515058d1da8fe75deb01.zip
Added that JavaScriptHelper#link_to_function will honor existing :onclick definitions when adding the function call [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/javascript_helper_test.rb')
-rw-r--r--actionpack/test/template/javascript_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb
index 48d1e263c1..6a01bd14b2 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionpack/test/template/javascript_helper_test.rb
@@ -26,4 +26,8 @@ class JavaScriptHelperTest < Test::Unit::TestCase
link_to_function("Greeting", "alert('Hello world!')")
end
+ def test_link_to_function_with_existing_onclick
+ assert_dom_equal %(<a href="#" onclick="alert('Hello world!'); confirm('Sanity!'); return false;">Greeting</a>),
+ link_to_function("Greeting", "alert('Hello world!')", :onclick => "confirm('Sanity!')")
+ end
end