1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

adding missing test coverage

This commit is contained in:
Eugene Gilburg 2014-07-18 20:55:22 -07:00
parent 348de3a06e
commit 080c2ba0ca

View file

@ -324,6 +324,10 @@ module RenderTestCases
@controller_view.render(customers, :greeting => "Hello") @controller_view.render(customers, :greeting => "Hello")
end 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 def test_render_partial_without_object_or_collection_does_not_generate_partial_name_local_variable
exception = assert_raises ActionView::Template::Error do exception = assert_raises ActionView::Template::Error do
@controller_view.render("partial_name_local_variable") @controller_view.render("partial_name_local_variable")
@ -388,6 +392,14 @@ module RenderTestCases
ActionView::Template.unregister_template_handler :foo ActionView::Template.unregister_template_handler :foo
end 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 def test_render_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization
ActionView::Template::Handlers.extensions ActionView::Template::Handlers.extensions
ActionView::Template.register_template_handler :foo, CustomHandler ActionView::Template.register_template_handler :foo, CustomHandler