diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-09-14 17:50:46 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-09-14 17:50:46 +0000 |
commit | 6dbac689a8d7f285ccdb2e3fa2b2967d731475ab (patch) | |
tree | 021f656f0cea1e4b13f9a8e47e02adb7eac2dde8 /actionpack/test | |
parent | 3ab1cb6a6a1ea0bde8ef35d02370248396753c7a (diff) | |
download | rails-6dbac689a8d7f285ccdb2e3fa2b2967d731475ab.tar.gz rails-6dbac689a8d7f285ccdb2e3fa2b2967d731475ab.tar.bz2 rails-6dbac689a8d7f285ccdb2e3fa2b2967d731475ab.zip |
Add chained replace/update support for assert_select_rjs [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/assert_select_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/actionpack/test/controller/assert_select_test.rb b/actionpack/test/controller/assert_select_test.rb index abeee689f4..bed8da622d 100644 --- a/actionpack/test/controller/assert_select_test.rb +++ b/actionpack/test/controller/assert_select_test.rb @@ -340,6 +340,33 @@ class AssertSelectTest < Test::Unit::TestCase assert_raises(AssertionFailedError) { assert_select_rjs :replace_html, "test1" } end + def test_assert_select_rjs_for_chained_replace + render_rjs do |page| + page['test1'].replace "<div id=\"1\">foo</div>" + page['test2'].replace_html "<div id=\"2\">foo</div>" + page.insert_html :top, "test3", "<div id=\"3\">foo</div>" + end + # Replace. + assert_select_rjs :chained_replace do + assert_select "div", 1 + assert_select "#1" + end + assert_select_rjs :chained_replace, "test1" do + assert_select "div", 1 + assert_select "#1" + end + assert_raises(AssertionFailedError) { assert_select_rjs :chained_replace, "test2" } + # Replace HTML. + assert_select_rjs :chained_replace_html do + assert_select "div", 1 + assert_select "#2" + end + assert_select_rjs :chained_replace_html, "test2" do + assert_select "div", 1 + assert_select "#2" + end + assert_raises(AssertionFailedError) { assert_select_rjs :replace_html, "test1" } + end def test_assert_select_rjs_for_insert render_rjs do |page| |