Skip to content

Commit 4442312

Browse files
e2josh
authored andcommitted
Additional template render test for backup files [rails#2367 state:resolved]
Signed-off-by: Joshua Peek <[email protected]>
1 parent cad3e8b commit 4442312

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The correct item.erb was loaded.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is an editor backup file and should never be loaded!

actionpack/test/template/render_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ def test_render_utf8_template
255255
assert_equal Encoding::UTF_8, result.encoding
256256
end
257257
end
258+
259+
def test_render_with_backup_files
260+
result = @view.render :file => "/test/backup_files/item"
261+
assert_equal "The correct item.erb was loaded.\n", result
262+
end
263+
258264
end
259265

260266
module TemplatesSetupTeardown

actionpack/test/template/template_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def test_template_path_parsing
1919
t.assert_parses_template_path 'abc', :extension => nil, :format => nil, :name => nil
2020
t.assert_parses_template_path 'abc.xxx', :extension => nil, :format => 'xxx', :name => 'abc'
2121
t.assert_parses_template_path 'abc.html.xxx', :extension => nil, :format => 'xxx', :name => 'abc'
22+
23+
t.assert_parses_template_path 'abc.html.erb.orig', :format => 'orig', :extension => nil
2224
end
2325
end
2426

0 commit comments

Comments
 (0)