mirror of
https://github.com/github/rails.git
synced 2026-01-31 01:08:19 -05:00
Test javascript_tag. Closes #7239.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6977 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -69,4 +69,14 @@ class JavaScriptHelperTest < Test::Unit::TestCase
|
||||
end
|
||||
assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update("header", "\\074h1\\076Greetings\\074/h1\\076");;" value="Greet me!" />), html
|
||||
end
|
||||
|
||||
def test_javascript_tag
|
||||
assert_dom_equal "<script type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>",
|
||||
javascript_tag("alert('hello')")
|
||||
end
|
||||
|
||||
def test_javascript_tag_with_options
|
||||
assert_dom_equal "<script id=\"the_js_tag\" type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>",
|
||||
javascript_tag("alert('hello')", :id => "the_js_tag")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user