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

Changeset 7181

Show
Ignore:
Timestamp:
07/11/07 23:32:02 (1 year ago)
Author:
nzkoz
Message:

Make sure missing template exceptions actually say which template they were looking for. Closes #8683 [dasil003]

Files:

Legend:

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

    r7177 r7181  
    11*SVN* 
     2 
     3* Make sure missing template exceptions actually say which template they were looking for.  Closes #8683 [dasil003] 
    24 
    35* Fix errors with around_filters which do not yield, restore 1.1 behaviour with after filters. Closes #8891 [skaes] 
  • trunk/actionpack/lib/action_controller/base.rb

    r7103 r7181  
    12421242      def assert_existence_of_template_file(template_name) 
    12431243        unless template_exists?(template_name) || ignore_missing_templates 
    1244           full_template_path = template_name.include?('.') ? template_name : @template.full_template_path(template_name, "#{@template.template_format}.erb") 
     1244          full_template_path = template_name.include?('.') ? template_name : "#{template_name}.#{@template.template_format}.erb" 
     1245          display_paths = view_paths.join(':') 
    12451246          template_type = (template_name =~ /layouts/i) ? 'layout' : 'template' 
    1246           raise(MissingTemplate, "Missing #{template_type} #{full_template_path}") 
     1247          raise(MissingTemplate, "Missing #{template_type} #{full_template_path} in view path #{display_paths}") 
    12471248        end 
    12481249      end 
  • trunk/actionpack/test/controller/rescue_test.rb

    r6862 r7181  
    1616    raise ActionController::NotImplemented.new(:get, :put) 
    1717  end 
     18   
     19  def missing_template; end 
    1820end 
    1921 
     
    114116    assert_response :not_found 
    115117    assert_equal ' ', @response.body 
     118  end 
     119 
     120 
     121  def test_rescue_missing_template_in_public 
     122    with_rails_root FIXTURE_PUBLIC do 
     123      with_all_requests_local true do 
     124        get :missing_template 
     125      end 
     126    end 
     127 
     128    assert_response :internal_server_error 
     129    assert @response.body.include?('missing_template'), "Response should include the template name." 
    116130  end 
    117131