diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-08 22:20:18 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-06-08 22:20:18 +0000 |
commit | a308ff0cdd573c2c71a7126d71089692d7dc8710 (patch) | |
tree | e7fcd260b1bfdbdbadf96e8cadadee55c529be29 /actionpack | |
parent | 29ce2eb9d1a8891259debe8b023b173ba33da426 (diff) | |
download | rails-a308ff0cdd573c2c71a7126d71089692d7dc8710.tar.gz rails-a308ff0cdd573c2c71a7126d71089692d7dc8710.tar.bz2 rails-a308ff0cdd573c2c71a7126d71089692d7dc8710.zip |
Test javascript_tag. Closes #7239.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6977 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/template/javascript_helper_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb index da574624ec..08bbd5e95f 100644 --- a/actionpack/test/template/javascript_helper_test.rb +++ b/actionpack/test/template/javascript_helper_test.rb @@ -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 |