annotate vendor/plugins/engines/test/functional/routes_test.rb @ 8:0c83d98252d9 yuya

* Add custom repo prefix and proper auth realm, remove auth cache (seems like an unwise feature), pass DB handle around, various other bits of tidying
author Chris Cannam
date Thu, 12 Aug 2010 15:31:37 +0100
parents 513646585e45
children
rev   line source
Chris@0 1 # Tests in this file ensure that:
Chris@0 2 #
Chris@0 3 # * Routes from plugins can be routed to
Chris@0 4 # * Named routes can be defined within a plugin
Chris@0 5
Chris@0 6 require File.dirname(__FILE__) + '/../test_helper'
Chris@0 7
Chris@0 8 class RoutesTest < ActionController::TestCase
Chris@0 9 tests TestRoutingController
Chris@0 10
Chris@0 11 def test_WITH_a_route_defined_in_a_plugin_IT_should_route_it
Chris@0 12 path = '/routes/an_action'
Chris@0 13 opts = {:controller => 'test_routing', :action => 'an_action'}
Chris@0 14 assert_routing path, opts
Chris@0 15 assert_recognizes opts, path # not sure what exactly the difference is, but it won't hurt either
Chris@0 16 end
Chris@0 17
Chris@0 18 def test_WITH_a_route_for_a_namespaced_controller_defined_in_a_plugin_IT_should_route_it
Chris@0 19 path = 'somespace/routes/an_action'
Chris@0 20 opts = {:controller => 'namespace/test_routing', :action => 'an_action'}
Chris@0 21 assert_routing path, opts
Chris@0 22 assert_recognizes opts, path
Chris@0 23 end
Chris@0 24
Chris@0 25 def test_should_properly_generate_named_routes
Chris@0 26 get :test_named_routes_from_plugin
Chris@0 27 assert_response_body '/somespace/routes'
Chris@0 28 end
Chris@0 29 end