aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-12-31 04:31:10 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-12-31 04:31:10 +0000
commit987d9dbf31b6bb4fe1547bca17af920aa3d72ac5 (patch)
tree6adb0224c6c75aa27be7e2502beae25cb89f7746 /actionpack/test
parentd7487fffe51d03f46800e266e4c972ab55238c89 (diff)
downloadrails-987d9dbf31b6bb4fe1547bca17af920aa3d72ac5.tar.gz
rails-987d9dbf31b6bb4fe1547bca17af920aa3d72ac5.tar.bz2
rails-987d9dbf31b6bb4fe1547bca17af920aa3d72ac5.zip
Added JavaScriptHelper#button_to_function that works just like JavaScriptHelper#link_to_function but uses a button instead of a href [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3367 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/javascript_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb
index ef830e4e98..f0a405fae3 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionpack/test/template/javascript_helper_test.rb
@@ -30,4 +30,9 @@ class JavaScriptHelperTest < Test::Unit::TestCase
assert_dom_equal %(<a href="#" onclick="confirm('Sanity!'); alert('Hello world!'); return false;">Greeting</a>),
link_to_function("Greeting", "alert('Hello world!')", :onclick => "confirm('Sanity!')")
end
+
+ def test_button_to_function
+ assert_dom_equal %(<input type="button" onclick="alert('Hello world!');" value="Greeting" />),
+ button_to_function("Greeting", "alert('Hello world!')")
+ end
end