From 2c3ca9ae80c0ec30ce1aede77c4dafc55bf2957e Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 17 Oct 2009 21:56:43 -0500 Subject: This is routing error message test is tightly coupled to the implementation. Just test that it raises an exception. --- actionpack/test/controller/routing_test.rb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'actionpack/test') 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 -- cgit v1.2.3