Skip to content

Commit

Permalink
Support render_template in view tests. Useful for specifying which
Browse files Browse the repository at this point in the history
partials are rendered under different conditions.

[#4903 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
dchelimsky authored and josevalim committed Jun 19, 2010
1 parent 1f84061 commit 86002a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions actionpack/lib/action_view/test_case.rb
Expand Up @@ -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 = ''

Expand Down
8 changes: 8 additions & 0 deletions actionpack/test/template/test_case_test.rb
Expand Up @@ -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

0 comments on commit 86002a0

Please sign in to comment.