aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-17 07:20:14 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-17 07:20:14 -0700
commitd9f936e61b15ae163e92ca92822b242baeec986d (patch)
treed78a704e9f10263b71bb008cf22ce9fe941bd613 /actionpack/test
parentc35a7d78ec2599b597296dc6749ca3d7ac434177 (diff)
parent13b0af736e6bd1242827409f59d528673b97fcc9 (diff)
downloadrails-d9f936e61b15ae163e92ca92822b242baeec986d.tar.gz
rails-d9f936e61b15ae163e92ca92822b242baeec986d.tar.bz2
rails-d9f936e61b15ae163e92ca92822b242baeec986d.zip
Merge pull request #7644 from insside/register_template_handler-method-refactoring
Allowing pass couple extension to one register_template_handler call
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/render_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index 6279abaae5..16a43fa0df 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -451,6 +451,15 @@ module RenderTestCases
assert_equal %(<title>David</title>),
@view.render(:file => "test/layout_render_object")
end
+
+ def test_render_with_passing_couple_extensions_to_one_register_template_handler_function_call
+ ActionView::Template.register_template_handler :foo1, :foo2, CustomHandler
+ assert_equal @view.render(:inline => "Hello, World!", :type => :foo1), @view.render(:inline => "Hello, World!", :type => :foo2)
+ end
+
+ def test_render_throws_exception_when_no_extensions_passed_to_register_template_handler_function_call
+ assert_raises(ArgumentError) { ActionView::Template.register_template_handler CustomHandler }
+ end
end
class CachedViewRenderTest < ActiveSupport::TestCase