aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2005-11-17 21:28:59 +0000
committerMarcel Molina <marcel@vernix.org>2005-11-17 21:28:59 +0000
commit06e74b6c91d48cd482ef7ee32817510dcd07f97a (patch)
tree6d93c120a7c396482c79144a56bd07a50c0e88b0 /actionpack/test/controller
parentfd66ccb01658b7cc7654e42233fd760b4fc788ff (diff)
downloadrails-06e74b6c91d48cd482ef7ee32817510dcd07f97a.tar.gz
rails-06e74b6c91d48cd482ef7ee32817510dcd07f97a.tar.bz2
rails-06e74b6c91d48cd482ef7ee32817510dcd07f97a.zip
Add support for new rjs templates which wrap an update_page block.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3078 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/new_render_test.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 919875e8c3..7cd17f1d55 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -154,6 +154,20 @@ class NewRenderTestController < ActionController::Base
render :action => "potential_conflicts"
end
+ def delete_with_js
+ @project_id = 4
+ end
+
+ def render_js_with_explicit_template
+ @project_id = 4
+ render :template => 'test/delete_with_js'
+ end
+
+ def render_js_with_explicit_action_template
+ @project_id = 4
+ render :action => 'delete_with_js'
+ end
+
def action_talk_to_layout
# Action template sets variable that's picked up by layout
end
@@ -279,6 +293,21 @@ class NewRenderTest < Test::Unit::TestCase
assert_equal "<p>This is grand!</p>\n", @response.body
end
+ def test_render_rjs_with_default
+ get :delete_with_js
+ assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight('project-4',{});!, @response.body
+ end
+
+ def test_render_rjs_template_explicitly
+ get :render_js_with_explicit_template
+ assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight('project-4',{});!, @response.body
+ end
+
+ def test_rendering_rjs_action_explicitly
+ get :render_js_with_explicit_action_template
+ assert_equal %!["person"].each(Element.remove);\nnew Effect.Highlight('project-4',{});!, @response.body
+ end
+
def test_layout_rendering
get :layout_test
assert_equal "<html>Hello world!</html>", @response.body