diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-06-25 05:47:01 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-06-25 05:49:38 -0500 |
commit | 6f5327013d6353c50cadfe2160d1b526ad687633 (patch) | |
tree | 61e61cd49bbad6e43ca98995884a2fc329c33d8e /actionpack/test/controller/custom_handler_test.rb | |
parent | 670e22e3724791f51d639f409930fba5af920081 (diff) | |
download | rails-6f5327013d6353c50cadfe2160d1b526ad687633.tar.gz rails-6f5327013d6353c50cadfe2160d1b526ad687633.tar.bz2 rails-6f5327013d6353c50cadfe2160d1b526ad687633.zip |
Consolidate CustomHandlerTest, TemplateFileTest, and TemplateObjectTest and test them at a higher level of abstraction in ViewRenderTest.
Diffstat (limited to 'actionpack/test/controller/custom_handler_test.rb')
-rw-r--r-- | actionpack/test/controller/custom_handler_test.rb | 45 |
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 |