Support render_template in view tests. Useful for specifying which

partials are rendered under different conditions.

[#4903 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
David Chelimsky 2010-06-18 22:20:10 -05:00 committed by José Valim
parent 1f84061c5c
commit 86002a0dfe
2 changed files with 9 additions and 0 deletions

View File

@ -84,6 +84,7 @@ module ActionView
def setup_with_controller
@controller = ActionView::TestCase::TestController.new
@request = @controller.request
@output_buffer = ActiveSupport::SafeBuffer.new
@rendered = ''

View File

@ -218,4 +218,12 @@ module ActionView
end
end
end
class RenderTemplateTest < ActionView::TestCase
test "render template" do
controller.controller_path = "test"
render(:template => "test/calling_partial_with_layout")
assert_template "partial_for_use_in_layout"
end
end
end