Skip to content
Browse files

Test javascript_tag. Closes #7239.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6977 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 29ce2eb commit a308ff0cdd573c2c71a7126d71089692d7dc8710 @jeremy jeremy committed Jun 8, 2007
Showing with 10 additions and 0 deletions.
  1. +10 −0 actionpack/test/template/javascript_helper_test.rb
View
10 actionpack/test/template/javascript_helper_test.rb
@@ -69,4 +69,14 @@ def test_button_to_function_with_rjs_block_and_options
end
assert_dom_equal %(<input type="button" class="greeter" onclick="Element.update(&quot;header&quot;, &quot;\\074h1\\076Greetings\\074/h1\\076&quot;);;" 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

0 comments on commit a308ff0

Please sign in to comment.
Something went wrong with that request. Please try again.