From 06e74b6c91d48cd482ef7ee32817510dcd07f97a Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Thu, 17 Nov 2005 21:28:59 +0000 Subject: 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 --- actionpack/test/controller/new_render_test.rb | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'actionpack/test/controller/new_render_test.rb') 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 "

This is grand!

\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 "Hello world!", @response.body -- cgit v1.2.3