Skip to content

Commit

Permalink
Test javascript_tag. Closes #7239.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6977 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Jun 8, 2007
1 parent 29ce2eb commit a308ff0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions actionpack/test/template/javascript_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.