diff options
author | thedarkone <nobody> | 2009-02-24 10:41:45 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-02-24 10:41:45 -0600 |
commit | 85df4841ddb3db3970fa9e798de698cf6f16752a (patch) | |
tree | 9d642c104169388ba86e80c44429885d40afc961 /actionpack/test/template | |
parent | b35562f432d0807517a614a540026c2fc557e2ac (diff) | |
download | rails-85df4841ddb3db3970fa9e798de698cf6f16752a.tar.gz rails-85df4841ddb3db3970fa9e798de698cf6f16752a.tar.bz2 rails-85df4841ddb3db3970fa9e798de698cf6f16752a.zip |
Template without a known template handler should only be reachable through its exact path. [#2027 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/render_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 107c625e32..de7fa3de65 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -224,6 +224,16 @@ module RenderTestCases assert_equal 'source: Hello, <%= name %>!; locals: {:name=>"Josh"}', @view.render(:inline => "Hello, <%= name %>!", :locals => { :name => "Josh" }, :type => :foo) end + def test_render_ignores_templates_with_malformed_template_handlers + %w(malformed malformed.erb malformed.html.erb malformed.en.html.erb).each do |name| + assert_raise(ActionView::MissingTemplate) { @view.render(:file => "test/malformed/#{name}") } + end + end + + def test_template_with_malformed_template_handler_is_reachable_trough_its_exact_filename + assert_equal "Don't render me!", @view.render(:file => 'test/malformed/malformed.html.erb~') + end + def test_render_with_layout assert_equal %(<title></title>\nHello world!\n), @view.render(:file => "test/hello_world.erb", :layout => "layouts/yield") |