提交 86002a0d 编写于 作者: D David Chelimsky 提交者: José Valim

Support render_template in view tests. Useful for specifying which

partials are rendered under different conditions.

[#4903 state:resolved]
Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 1f84061c
......@@ -84,6 +84,7 @@ def include_helper_modules!
def setup_with_controller
@controller = ActionView::TestCase::TestController.new
@request = @controller.request
@output_buffer = ActiveSupport::SafeBuffer.new
@rendered = ''
......
......@@ -218,4 +218,12 @@ def render_from_helper
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册