Chris@909: # Tests in this file ensure that: Chris@909: # Chris@909: # * Routes from plugins can be routed to Chris@909: # * Named routes can be defined within a plugin Chris@909: Chris@909: require File.dirname(__FILE__) + '/../test_helper' Chris@909: Chris@909: class RoutesTest < ActionController::TestCase Chris@909: tests TestRoutingController Chris@909: Chris@909: def test_WITH_a_route_defined_in_a_plugin_IT_should_route_it Chris@909: path = '/routes/an_action' Chris@909: opts = {:controller => 'test_routing', :action => 'an_action'} Chris@909: assert_routing path, opts Chris@909: assert_recognizes opts, path # not sure what exactly the difference is, but it won't hurt either Chris@909: end Chris@909: Chris@909: def test_WITH_a_route_for_a_namespaced_controller_defined_in_a_plugin_IT_should_route_it Chris@909: path = 'somespace/routes/an_action' Chris@909: opts = {:controller => 'namespace/test_routing', :action => 'an_action'} Chris@909: assert_routing path, opts Chris@909: assert_recognizes opts, path Chris@909: end Chris@909: Chris@909: def test_should_properly_generate_named_routes Chris@909: get :test_named_routes_from_plugin Chris@909: assert_response_body '/somespace/routes' Chris@909: end Chris@909: end