Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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>
  • Loading branch information...
commit 86002a0dfe45c972a2498e33a6a2a882804603bd 1 parent 1f84061
@dchelimsky dchelimsky authored josevalim committed
View
1  actionpack/lib/action_view/test_case.rb
@@ -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 = ''
View
8 actionpack/test/template/test_case_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.