diff options
author | Sam Stephenson <sam@37signals.com> | 2006-02-12 01:30:13 +0000 |
---|---|---|
committer | Sam Stephenson <sam@37signals.com> | 2006-02-12 01:30:13 +0000 |
commit | 838ec413ebe08be71eea3dec0b061c6f609c839f (patch) | |
tree | 8df6658227aeeb613ec809d0da6539bb2d956eeb /actionpack/test | |
parent | e90bbbdd837ffc83dccbd05528c4f1521e3956ee (diff) | |
download | rails-838ec413ebe08be71eea3dec0b061c6f609c839f.tar.gz rails-838ec413ebe08be71eea3dec0b061c6f609c839f.tar.bz2 rails-838ec413ebe08be71eea3dec0b061c6f609c839f.zip |
Add JavaScriptGenerator#replace_element for replacing an element's "outer HTML". Closes #3246.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index eef6841727..fc4ebeccc3 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -171,6 +171,11 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase @generator.replace_html('element', '<p>This is a test</p>') end + def test_replace_element_with_string + assert_equal 'Element.replace("element", "<div id=\"element\"><p>This is a test</p></div>");', + @generator.replace_element('element', '<div id="element"><p>This is a test</p></div>') + end + def test_remove assert_equal '["foo"].each(Element.remove);', @generator.remove('foo') |