diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-10-17 21:56:43 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-10-17 21:56:43 -0500 |
commit | 2c3ca9ae80c0ec30ce1aede77c4dafc55bf2957e (patch) | |
tree | 9da4129d9c3a465014736e3de92cc146f5e71a32 | |
parent | f1767c1513172415d53f8aa347d9936f85560128 (diff) | |
download | rails-2c3ca9ae80c0ec30ce1aede77c4dafc55bf2957e.tar.gz rails-2c3ca9ae80c0ec30ce1aede77c4dafc55bf2957e.tar.bz2 rails-2c3ca9ae80c0ec30ce1aede77c4dafc55bf2957e.zip |
This is routing error message test is tightly coupled to the implementation. Just test that it raises an exception.
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 3b70e7162c..83b26ba5a9 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -407,22 +407,7 @@ class LegacyRouteSetTests < Test::Unit::TestCase rs.draw do |map| map.post 'post/:id', :controller=> 'post', :action=> 'show', :requirements => {:id => /\d+/} end - exception = assert_raise(ActionController::RoutingError) { rs.generate(:controller => 'post', :action => 'show', :bad_param => "foo", :use_route => "post") } - assert_match /^post_url failed to generate/, exception.message - from_match = exception.message.match(/from \{[^\}]+\}/).to_s - assert_match /:bad_param=>"foo"/, from_match - assert_match /:action=>"show"/, from_match - assert_match /:controller=>"post"/, from_match - - expected_match = exception.message.match(/expected: \{[^\}]+\}/).to_s - assert_no_match /:bad_param=>"foo"/, expected_match - assert_match /:action=>"show"/, expected_match - assert_match /:controller=>"post"/, expected_match - - diff_match = exception.message.match(/diff: \{[^\}]+\}/).to_s - assert_match /:bad_param=>"foo"/, diff_match - assert_no_match /:action=>"show"/, diff_match - assert_no_match /:controller=>"post"/, diff_match + assert_raise(ActionController::RoutingError) { rs.generate(:controller => 'post', :action => 'show', :bad_param => "foo", :use_route => "post") } end def test_dynamic_path_allowed |