Improve tests (closes #7240) [josh]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7581 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2007-09-22 23:11:45 +00:00
parent ee45d76df8
commit f0dc2774e8

View File

@@ -53,6 +53,11 @@ class JavaScriptHelperTest < Test::Unit::TestCase
link_to_function("Greeting", "alert('Hello world!')", :href => 'http://example.com/')
end
def test_link_to_function_with_href
assert_dom_equal %(<a href="http://example.com/" onclick="alert('Hello world!'); return false;">Greeting</a>),
link_to_function("Greeting", "alert('Hello world!')", :href => 'http://example.com/')
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!')")