aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorCezary Baginski <cezary.baginski@gmail.com>2009-04-02 11:58:29 -0500
committerJoshua Peek <josh@joshpeek.com>2009-04-02 11:58:29 -0500
commit44423126c6f6133a1d9cf1d0832b527e8711d40f (patch)
tree9d08651844ef31aa00a6937695e8a34169fac617 /actionpack
parentcad3e8b261a8d9551bc19a57007acf574d957548 (diff)
downloadrails-44423126c6f6133a1d9cf1d0832b527e8711d40f.tar.gz
rails-44423126c6f6133a1d9cf1d0832b527e8711d40f.tar.bz2
rails-44423126c6f6133a1d9cf1d0832b527e8711d40f.zip
Additional template render test for backup files [#2367 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/fixtures/test/backup_files/item.html.erb1
-rw-r--r--actionpack/test/fixtures/test/backup_files/item.html.erb.orig1
-rw-r--r--actionpack/test/template/render_test.rb6
-rw-r--r--actionpack/test/template/template_test.rb2
4 files changed, 10 insertions, 0 deletions
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