Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8385

Show
Ignore:
Timestamp:
12/14/07 18:07:20 (2 years ago)
Author:
david
Message:

Fixed that ActionView#file_exists? would be incorrect if @first_render is set (closes #10569) [dbussink]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r8384 r8385  
    11*SVN* 
     2 
     3* Fixed that ActionView#file_exists? would be incorrect if @first_render is set #10569 [dbussink] 
    24 
    35* Added that Array#to_param calls to_param on all it's elements #10473 [brandon] 
  • trunk/actionpack/lib/action_view/base.rb

    r8374 r8385  
    405405        template_exists?(template_file_name, template_file_extension) 
    406406      else 
    407         pick_template_extension(template_path
     407        template_exists?(template_file_name, pick_template_extension(template_path)
    408408      end 
    409409    end 
  • trunk/actionpack/test/action_view_test.rb

    r8187 r8385  
    2424    end 
    2525  end 
     26   
     27  def test_should_report_file_exists_correctly 
     28    base = ActionView::Base.new 
     29 
     30    assert_nil base.send(:find_template_extension_from_first_render) 
     31     
     32    assert_equal false, base.send(:file_exists?, 'test.rhtml') 
     33    assert_equal false, base.send(:file_exists?, 'test.rb') 
     34 
     35    base.instance_variable_set('@first_render', 'foo.rb') 
     36     
     37    assert_equal 'rb', base.send(:find_template_extension_from_first_render) 
     38     
     39    assert_equal false, base.send(:file_exists?, 'baz') 
     40    assert_equal false, base.send(:file_exists?, 'baz.rb') 
     41 
     42  end 
     43   
    2644end