Changeset 3884
- Timestamp:
- 03/16/06 02:51:19 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_view/base.rb
r3856 r3884 222 222 223 223 if use_full_path 224 template_path_without_extension, template_extension = template_path.split('.')224 template_path_without_extension, template_extension = path_and_extension(template_path) 225 225 226 226 if template_extension … … 336 336 337 337 def file_exists?(template_path)#:nodoc: 338 template_file_name, template_file_extension = template_path.split(".")338 template_file_name, template_file_extension = path_and_extension(template_path) 339 339 340 340 if template_file_extension … … 360 360 file_path = full_template_path(template_path, extension) 361 361 @@method_names.has_key?(file_path) || FileTest.exists?(file_path) 362 end 363 364 def path_and_extension(template_path) 365 template_path_without_extension = template_path.sub(/\.(\w+)$/, '') 366 [ template_path_without_extension, $1 ] 362 367 end 363 368 trunk/actionpack/test/controller/new_render_test.rb
r3856 r3884 74 74 render :file => 'test/render_file_with_ivar', :use_full_path => true 75 75 end 76 76 77 def render_file_not_using_full_path_with_relative_path 78 @secret = 'in the sauce' 79 render :file => 'test/../test/render_file_with_ivar', :use_full_path => true 80 end 81 82 def render_file_not_using_full_path_with_dot_in_path 83 @secret = 'in the sauce' 84 render :file => 'test/dot.directory/render_file_with_ivar', :use_full_path => true 85 end 86 77 87 def render_xml_hello 78 88 @name = "David" … … 354 364 end 355 365 366 def test_render_file_not_using_full_path_with_relative_path 367 get :render_file_not_using_full_path_with_relative_path 368 assert_equal "The secret is in the sauce\n", @response.body 369 end 370 371 def test_render_file_not_using_full_path_with_dot_in_path 372 get :render_file_not_using_full_path_with_dot_in_path 373 assert_equal "The secret is in the sauce\n", @response.body 374 end 375 356 376 def test_render_file_with_locals 357 377 get :render_file_with_locals