1 require File.dirname(__FILE__) + '/../abstract_unit'
8 def render( template, local_assigns )
15 class CustomHandlerTest < Test::Unit::TestCase
17 ActionView::Base.register_template_handler "foo", CustomHandler
18 ActionView::Base.register_template_handler :foo2, CustomHandler
19 @view = ActionView::Base.new
22 def test_custom_render
23 result = @view.render_template( "foo", "hello <%= one %>", nil, :one => "two" )
25 [ "hello <%= one %>", { :one => "two" }, @view ],
29 def test_custom_render2
30 result = @view.render_template( "foo2", "hello <%= one %>", nil, :one => "two" )
32 [ "hello <%= one %>", { :one => "two" }, @view ],
36 def test_unhandled_extension
37 # uses the ERb handler by default if the extension isn't recognized
38 result = @view.render_template( "bar", "hello <%= one %>", nil, :one => "two" )
39 assert_equal "hello two", result