From dde5b8737bf7ec666f96ae04479074dfae7a63d9 Mon Sep 17 00:00:00 2001 From: Trek Glowacki Date: Tue, 16 Aug 2011 16:27:07 -0400 Subject: When a route references a missing controller, raise ActionController::RoutingError with a clearer message --- actionpack/test/controller/routing_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 5bf68decca..3602c8a9e3 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -902,6 +902,16 @@ class RouteSetTest < ActiveSupport::TestCase end end + def test_route_error_with_missing_controller + set.draw do + get "/people" => "missing#index" + end + + assert_raise(ActionController::RoutingError) { + set.recognize_path("/people", :method => :get) + } + end + def test_recognize_with_encoded_id_and_regex set.draw do match 'page/:id' => 'pages#show', :id => /[a-zA-Z0-9\+]+/ -- cgit v1.2.3