diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/template_object_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/actionpack/test/template/template_object_test.rb b/actionpack/test/template/template_object_test.rb index 780df17f0c..b3a33938cf 100644 --- a/actionpack/test/template/template_object_test.rb +++ b/actionpack/test/template/template_object_test.rb @@ -59,4 +59,32 @@ class TemplateObjectTest < Test::Unit::TestCase end end + class PartialTemplateFallbackTest < Test::Unit::TestCase + def setup + @view = ActionView::Base.new(LOAD_PATH_ROOT) + @path = 'test/layout_for_partial' + end + + def test_default + template = ActionView::PartialTemplate.new(@view, @path, nil) + assert_equal 'test/_layout_for_partial', template.path + assert_equal 'erb', template.extension + assert_equal :html, @view.template_format + end + + def test_js + @view.template_format = :js + template = ActionView::PartialTemplate.new(@view, @path, nil) + assert_equal 'test/_layout_for_partial', template.path + assert_equal 'erb', template.extension + assert_equal :html, @view.template_format + end + + def test_xml + @view.template_format = :xml + assert_raise ActionView::ActionViewError do + ActionView::PartialTemplate.new(@view, @path, nil) + end + end + end end |