aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/assert_select_test.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2007-05-26 17:29:23 +0000
committerMarcel Molina <marcel@vernix.org>2007-05-26 17:29:23 +0000
commit42ebf559cc6ed80fa3bf55ecc1dea7c9e593f45e (patch)
tree234c07005e9539121aa6d3ec1ddb2b8ffd7b341a /actionpack/test/controller/assert_select_test.rb
parentdc4d23f2d736a81be36edb0abf42774634741bf3 (diff)
downloadrails-42ebf559cc6ed80fa3bf55ecc1dea7c9e593f45e.tar.gz
rails-42ebf559cc6ed80fa3bf55ecc1dea7c9e593f45e.tar.bz2
rails-42ebf559cc6ed80fa3bf55ecc1dea7c9e593f45e.zip
Add support for assert_select_rjs with :show and :hide. #7780 [dchelimsky]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6861 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/assert_select_test.rb')
-rw-r--r--actionpack/test/controller/assert_select_test.rb66
1 files changed, 64 insertions, 2 deletions
diff --git a/actionpack/test/controller/assert_select_test.rb b/actionpack/test/controller/assert_select_test.rb
index 36075a0871..b0f3d6cedc 100644
--- a/actionpack/test/controller/assert_select_test.rb
+++ b/actionpack/test/controller/assert_select_test.rb
@@ -452,6 +452,69 @@ class AssertSelectTest < Test::Unit::TestCase
end
end
+ # Simple show
+ def test_assert_select_rjs_for_show
+ render_rjs do |page|
+ page.show "test1"
+ end
+
+ assert_select_rjs :show, "test1"
+ end
+
+ def test_assert_select_rjs_for_show_ignores_block
+ render_rjs do |page|
+ page.show "test1"
+ end
+
+ assert_nothing_raised do
+ assert_select_rjs :show, "test1" do
+ assert_select "p"
+ end
+ end
+ end
+
+ # Simple hide
+ def test_assert_select_rjs_for_hide
+ render_rjs do |page|
+ page.hide "test1"
+ end
+
+ assert_select_rjs :hide, "test1"
+ end
+
+ def test_assert_select_rjs_for_hide_ignores_block
+ render_rjs do |page|
+ page.hide "test1"
+ end
+
+ assert_nothing_raised do
+ assert_select_rjs :hide, "test1" do
+ assert_select "p"
+ end
+ end
+ end
+
+ # Simple toggle
+ def test_assert_select_rjs_for_toggle
+ render_rjs do |page|
+ page.toggle "test1"
+ end
+
+ assert_select_rjs :toggle, "test1"
+ end
+
+ def test_assert_select_rjs_for_toggle_ignores_block
+ render_rjs do |page|
+ page.toggle "test1"
+ end
+
+ assert_nothing_raised do
+ assert_select_rjs :toggle, "test1" do
+ assert_select "p"
+ end
+ end
+ end
+
# Non-positioned insert.
def test_assert_select_rjs_for_nonpositioned_insert
render_rjs do |page|
@@ -498,8 +561,7 @@ class AssertSelectTest < Test::Unit::TestCase
assert_select "div", 4
end
end
-
-
+
# Simple selection from a single result.
def test_nested_assert_select_rjs_with_single_result
render_rjs do |page|