From 44423126c6f6133a1d9cf1d0832b527e8711d40f Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Thu, 2 Apr 2009 11:58:29 -0500 Subject: Additional template render test for backup files [#2367 state:resolved] Signed-off-by: Joshua Peek --- actionpack/test/fixtures/test/backup_files/item.html.erb | 1 + actionpack/test/fixtures/test/backup_files/item.html.erb.orig | 1 + actionpack/test/template/render_test.rb | 6 ++++++ actionpack/test/template/template_test.rb | 2 ++ 4 files changed, 10 insertions(+) create mode 100644 actionpack/test/fixtures/test/backup_files/item.html.erb create mode 100644 actionpack/test/fixtures/test/backup_files/item.html.erb.orig (limited to 'actionpack/test') diff --git a/actionpack/test/fixtures/test/backup_files/item.html.erb b/actionpack/test/fixtures/test/backup_files/item.html.erb new file mode 100644 index 0000000000..aaac0a2160 --- /dev/null +++ b/actionpack/test/fixtures/test/backup_files/item.html.erb @@ -0,0 +1 @@ +The correct item.erb was loaded. diff --git a/actionpack/test/fixtures/test/backup_files/item.html.erb.orig b/actionpack/test/fixtures/test/backup_files/item.html.erb.orig new file mode 100644 index 0000000000..a2b153e5a2 --- /dev/null +++ b/actionpack/test/fixtures/test/backup_files/item.html.erb.orig @@ -0,0 +1 @@ +This is an editor backup file and should never be loaded! diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 9adf053b09..80fd549fd7 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -255,6 +255,12 @@ module RenderTestCases assert_equal Encoding::UTF_8, result.encoding end end + + def test_render_with_backup_files + result = @view.render :file => "/test/backup_files/item" + assert_equal "The correct item.erb was loaded.\n", result + end + end module TemplatesSetupTeardown diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb index 7caec7ad9f..5c6523201b 100644 --- a/actionpack/test/template/template_test.rb +++ b/actionpack/test/template/template_test.rb @@ -19,6 +19,8 @@ class TemplateTest < Test::Unit::TestCase t.assert_parses_template_path 'abc', :extension => nil, :format => nil, :name => nil t.assert_parses_template_path 'abc.xxx', :extension => nil, :format => 'xxx', :name => 'abc' t.assert_parses_template_path 'abc.html.xxx', :extension => nil, :format => 'xxx', :name => 'abc' + + t.assert_parses_template_path 'abc.html.erb.orig', :format => 'orig', :extension => nil end end -- cgit v1.2.3