diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-16 02:51:19 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-16 02:51:19 +0000 |
commit | 7d06259be9b1b20816dd3502a0fd6f311ef6b24b (patch) | |
tree | 97803d5d9d0c493be6454ec873484ca0cdd322ce /actionpack/test/controller | |
parent | 500c7349353e8161dee6c96935a87137e9e78e1d (diff) | |
download | rails-7d06259be9b1b20816dd3502a0fd6f311ef6b24b.tar.gz rails-7d06259be9b1b20816dd3502a0fd6f311ef6b24b.tar.bz2 rails-7d06259be9b1b20816dd3502a0fd6f311ef6b24b.zip |
Dots in template path should not trip up rendering (closes #4244) [lmarlow@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3884 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb index 961269da59..0722bb9fd6 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -73,7 +73,17 @@ class NewRenderTestController < ActionController::Base @secret = 'in the sauce' render :file => 'test/render_file_with_ivar', :use_full_path => true end + + def render_file_not_using_full_path_with_relative_path + @secret = 'in the sauce' + render :file => 'test/../test/render_file_with_ivar', :use_full_path => true + end + def render_file_not_using_full_path_with_dot_in_path + @secret = 'in the sauce' + render :file => 'test/dot.directory/render_file_with_ivar', :use_full_path => true + end + def render_xml_hello @name = "David" render :template => "test/hello" @@ -353,6 +363,16 @@ class NewRenderTest < Test::Unit::TestCase assert_equal "The secret is in the sauce\n", @response.body end + def test_render_file_not_using_full_path_with_relative_path + get :render_file_not_using_full_path_with_relative_path + assert_equal "The secret is in the sauce\n", @response.body + end + + def test_render_file_not_using_full_path_with_dot_in_path + get :render_file_not_using_full_path_with_dot_in_path + assert_equal "The secret is in the sauce\n", @response.body + end + def test_render_file_with_locals get :render_file_with_locals assert_equal "The secret is in the sauce\n", @response.body @@ -577,4 +597,4 @@ EOS get :hello_world_from_rxml_using_action assert_equal "<html>\n <p>Hello</p>\n</html>\n", @response.body end -end
\ No newline at end of file +end |