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