Permalink
Browse files

Add test for routes_for_controller_and_action deprecation [#3023]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information...
1 parent 8058a1d commit c41fb5865f342fd88df45a9a920ac582a17f314d @simonjefford simonjefford committed with lifo Aug 9, 2009
@@ -464,7 +464,7 @@ def routes_for(options, merged, expire_on)
end
def routes_for_controller_and_action(controller, action)
- ActionSupport::Deprecation.warn "routes_for_controller_and_action() has been deprecated. Please use routes_for()"
+ ActiveSupport::Deprecation.warn "routes_for_controller_and_action() has been deprecated. Please use routes_for()"
selected = routes.select do |route|
route.matches_controller_and_action? controller, action
end
@@ -1,5 +1,6 @@
require 'abstract_unit'
require 'controller/fake_controllers'
+require 'action_controller/routing/route_set'
class MilestonesController < ActionController::Base
def index() head :ok end
@@ -742,7 +743,7 @@ def request
end
end
-class LegacyRouteSetTests < Test::Unit::TestCase
+class LegacyRouteSetTests < ActiveSupport::TestCase
attr_reader :rs
def setup
@@ -758,6 +759,10 @@ def teardown
@rs.clear!
end
+ def test_routes_for_controller_and_action_deprecated
+ assert_deprecated { @rs.routes_for_controller_and_action("controller", "action") }
+ end
+
def test_default_setup
@rs.draw {|m| m.connect ':controller/:action/:id' }
assert_equal({:controller => "content", :action => 'index'}, rs.recognize_path("/content"))

0 comments on commit c41fb58

Please sign in to comment.