mirror of https://github.com/rails/rails
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:
parent
1f84061c5c
commit
86002a0dfe
|
@ -84,6 +84,7 @@ module ActionView
|
|||
|
||||
def setup_with_controller
|
||||
@controller = ActionView::TestCase::TestController.new
|
||||
@request = @controller.request
|
||||
@output_buffer = ActiveSupport::SafeBuffer.new
|
||||
@rendered = ''
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue