diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/action_view_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/action_view_test.rb b/actionpack/test/action_view_test.rb index 729438af32..a69ff36f9f 100644 --- a/actionpack/test/action_view_test.rb +++ b/actionpack/test/action_view_test.rb @@ -23,4 +23,22 @@ class ActionViewTests < Test::Unit::TestCase assert_equal expectation, base.send(:find_template_extension_from_first_render) end end + + def test_should_report_file_exists_correctly + base = ActionView::Base.new + + assert_nil base.send(:find_template_extension_from_first_render) + + assert_equal false, base.send(:file_exists?, 'test.rhtml') + assert_equal false, base.send(:file_exists?, 'test.rb') + + base.instance_variable_set('@first_render', 'foo.rb') + + assert_equal 'rb', base.send(:find_template_extension_from_first_render) + + assert_equal false, base.send(:file_exists?, 'baz') + assert_equal false, base.send(:file_exists?, 'baz.rb') + + end + end |