aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
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