From 68d685056a6a8a6fcb7f922c161d26a54c770213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Thu, 6 Sep 2007 14:28:32 +0000 Subject: Remove deprecated named routes [pixeltrix] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7415 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/routing_test.rb | 54 +----------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'actionpack/test/controller/routing_test.rb') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 858ec6f3d1..5ca63396b4 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -22,7 +22,7 @@ class UriReservedCharactersRoutingTest < Test::Unit::TestCase map.connect ':controller/:action/:variable' end - safe, unsafe = %w(: @ & = + $ , ;), %w(^ / ? # [ ]) + safe, unsafe = %w(: @ & = + $), %w(^ / ? # [ ] , ;) hex = unsafe.map { |char| '%' + char.unpack('H2').first.upcase } @segment = "#{safe}#{unsafe}".freeze @@ -1024,42 +1024,6 @@ class RouteTest < Test::Unit::TestCase end end -class MapperDeprecatedRouteTest < Test::Unit::TestCase - def setup - @set = mock("set") - @mapper = ActionController::Routing::RouteSet::Mapper.new(@set) - end - - def test_should_add_new_and_deprecated_named_routes - @set.expects(:add_named_route).with("new", "path", {:a => "b"}) - @set.expects(:add_deprecated_named_route).with("new", "old", "path", {:a => "b"}) - @mapper.deprecated_named_route("new", "old", "path", {:a => "b"}) - end - - def test_should_not_add_deprecated_named_route_if_both_are_the_same - @set.expects(:add_named_route).with("new", "path", {:a => "b"}) - @set.expects(:add_deprecated_named_route).with("new", "new", "path", {:a => "b"}).never - @mapper.deprecated_named_route("new", "new", "path", {:a => "b"}) - end -end - -class RouteSetDeprecatedRouteTest < Test::Unit::TestCase - def setup - @set = ActionController::Routing::RouteSet.new - end - - def test_should_add_deprecated_route - @set.expects(:add_named_route).with("old", "path", {:a => "b"}) - @set.add_deprecated_named_route("new", "old", "path", {:a => "b"}) - end - - def test_should_fire_deprecation_warning_on_access - @set.add_deprecated_named_route("new_outer_inner_path", "outer_new_inner_path", "/outers/:outer_id/inners/new", :controller => :inners) - ActiveSupport::Deprecation.expects(:warn) - @set.named_routes["outer_new_inner_path"] - end -end - end # uses_mocha class RouteBuilderTest < Test::Unit::TestCase @@ -1213,22 +1177,6 @@ class RouteBuilderTest < Test::Unit::TestCase assert_equal nil, builder.warn_output # should only warn on the :person segment end - def test_comma_isnt_a_route_separator - segments = builder.segments_for_route_path '/books/:id,:action' - defaults = { :action => 'show' } - assert_raise(ArgumentError) do - builder.assign_route_options(segments, defaults, {}) - end - end - - def test_semicolon_isnt_a_route_separator - segments = builder.segments_for_route_path '/books/:id;:action' - defaults = { :action => 'show' } - assert_raise(ArgumentError) do - builder.assign_route_options(segments, defaults, {}) - end - end - def test_segmentation_of_dot_path segments = builder.segments_for_route_path '/books/:action.rss' assert builder.assign_route_options(segments, {}, {}).empty? -- cgit v1.2.3