aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/custom_handler_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/custom_handler_test.rb')
-rw-r--r--actionpack/test/controller/custom_handler_test.rb45
1 files changed, 0 insertions, 45 deletions
diff --git a/actionpack/test/controller/custom_handler_test.rb b/actionpack/test/controller/custom_handler_test.rb
deleted file mode 100644
index ac484ae17e..0000000000
--- a/actionpack/test/controller/custom_handler_test.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'abstract_unit'
-
-class CustomHandler < ActionView::TemplateHandler
- def initialize( view )
- @view = view
- end
-
- def render( template )
- [ template.source,
- template.locals,
- @view ]
- end
-end
-
-class CustomHandlerTest < Test::Unit::TestCase
- def setup
- ActionView::Template.register_template_handler "foo", CustomHandler
- ActionView::Template.register_template_handler :foo2, CustomHandler
- @view = ActionView::Base.new
- end
-
- def test_custom_render
- template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "foo")
-
- result = @view.render_template(template)
- assert_equal(
- [ "hello <%= one %>", { :one => "two" }, @view ],
- result )
- end
-
- def test_custom_render2
- template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "foo2")
- result = @view.render_template(template)
- assert_equal(
- [ "hello <%= one %>", { :one => "two" }, @view ],
- result )
- end
-
- def test_unhandled_extension
- # uses the ERb handler by default if the extension isn't recognized
- template = ActionView::InlineTemplate.new(@view, "hello <%= one %>", { :one => "two" }, "bar")
- result = @view.render_template(template)
- assert_equal "hello two", result
- end
-end