diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-19 14:22:00 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-19 14:22:00 -0300 |
commit | e89ef3cee9a38f69634e8e7d55dc69841b06e55d (patch) | |
tree | 67551670acaefa85ad913150ab4d23ea84fe9c12 /actionview/test/template/render_test.rb | |
parent | 433c52864a703312497d5f07c01a17e6fbc769aa (diff) | |
parent | 080c2ba0cadc9789ae97a35ef23808d3c0197b9c (diff) | |
download | rails-e89ef3cee9a38f69634e8e7d55dc69841b06e55d.tar.gz rails-e89ef3cee9a38f69634e8e7d55dc69841b06e55d.tar.bz2 rails-e89ef3cee9a38f69634e8e7d55dc69841b06e55d.zip |
Merge pull request #16224 from egilburg/renderer_refactors
Some ActionView renderer refactors
Diffstat (limited to 'actionview/test/template/render_test.rb')
-rw-r--r-- | actionview/test/template/render_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index c13e59d82b..85817119ba 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -324,6 +324,10 @@ module RenderTestCases @controller_view.render(customers, :greeting => "Hello") end + def test_render_partial_using_collection_without_path + assert_equal "hi good customer: david0", @controller_view.render([ GoodCustomer.new("david") ], greeting: "hi") + end + def test_render_partial_without_object_or_collection_does_not_generate_partial_name_local_variable exception = assert_raises ActionView::Template::Error do @controller_view.render("partial_name_local_variable") @@ -388,6 +392,14 @@ module RenderTestCases ActionView::Template.unregister_template_handler :foo end + def test_render_body + assert_equal 'some body', @view.render(body: 'some body') + end + + def test_render_plain + assert_equal 'some plaintext', @view.render(plain: 'some plaintext') + end + def test_render_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization ActionView::Template::Handlers.extensions ActionView::Template.register_template_handler :foo, CustomHandler |