diff options
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 22f7fcb790..7765c62a5e 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -152,6 +152,23 @@ class TestController < ActionController::Base end end + def default_render + if @alternate_default_render + @alternate_default_render.call + else + render + end + end + + def render_alternate_default + # For this test, the method "default_render" is overridden: + @alternate_default_render = lambda { + render :update do |page| + page.replace :foo, :partial => 'partial' + end + } + end + def rescue_action(e) raise end private @@ -413,6 +430,11 @@ class RenderTest < Test::Unit::TestCase assert_equal 'partial js', @response.body end + def test_should_render_with_alternate_default_render + xhr :get, :render_alternate_default + assert_equal %(Element.replace("foo", "partial html");), @response.body + end + protected def etag_for(text) |