diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-14 13:18:23 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-15 17:21:33 +0000 |
commit | db06d128262b49c8b02e153cf95eb46f4eff364b (patch) | |
tree | 3c13c918da182f1ba9f29f39623597fab6d46bac /actionpack/test/journey | |
parent | c372eec97c53cd3af55443201b74bfe80747d313 (diff) | |
download | rails-db06d128262b49c8b02e153cf95eb46f4eff364b.tar.gz rails-db06d128262b49c8b02e153cf95eb46f4eff364b.tar.bz2 rails-db06d128262b49c8b02e153cf95eb46f4eff364b.zip |
Raise correct exception now Journey is integrated.
Now that Journey has been integrated into ActionDispatch we can raise
the exception ActionController::UrlGenerationError directly rather than
raising the internal Journey::Router::RoutingError and then have
ActionDispatch::Routing::RouteSet#generate re-raise the exception.
Diffstat (limited to 'actionpack/test/journey')
-rw-r--r-- | actionpack/test/journey/router_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb index 27bdb0108a..3d52b2e9ee 100644 --- a/actionpack/test/journey/router_test.rb +++ b/actionpack/test/journey/router_test.rb @@ -155,7 +155,7 @@ module ActionDispatch Router::Strexp.new("/foo/:id", { :id => /\d/ }, ['/', '.', '?'], false) ] - assert_raises(Router::RoutingError) do + assert_raises(ActionController::UrlGenerationError) do @formatter.generate(:path_info, nil, { :id => '10' }, { }) end end @@ -168,7 +168,7 @@ module ActionDispatch path, _ = @formatter.generate(:path_info, nil, { :id => '10' }, { }) assert_equal '/foo/10', path - assert_raises(Router::RoutingError) do + assert_raises(ActionController::UrlGenerationError) do @formatter.generate(:path_info, nil, { :id => 'aa' }, { }) end end @@ -194,11 +194,11 @@ module ActionDispatch path = Path::Pattern.new pattern @router.routes.add_route nil, path, {}, {}, route_name - error = assert_raises(Router::RoutingError) do + error = assert_raises(ActionController::UrlGenerationError) do @formatter.generate(:path_info, route_name, { }, { }) end - assert_match(/required keys: \[:id\]/, error.message) + assert_match(/missing required keys: \[:id\]/, error.message) end def test_X_Cascade |