To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / d1 / d1f808fff3001eb66af368407709979594e75713.svn-base @ 1297:0a574315af3e
History | View | Annotate | Download (974 Bytes)
| 1 |
# Tests in this file ensure that: |
|---|---|
| 2 |
# |
| 3 |
# * Routes from plugins can be routed to |
| 4 |
# * Named routes can be defined within a plugin |
| 5 |
|
| 6 |
require File.dirname(__FILE__) + '/../test_helper' |
| 7 |
|
| 8 |
class RoutesTest < ActionController::TestCase |
| 9 |
tests TestRoutingController |
| 10 |
|
| 11 |
def test_WITH_a_route_defined_in_a_plugin_IT_should_route_it |
| 12 |
path = '/routes/an_action' |
| 13 |
opts = {:controller => 'test_routing', :action => 'an_action'}
|
| 14 |
assert_routing path, opts |
| 15 |
assert_recognizes opts, path # not sure what exactly the difference is, but it won't hurt either |
| 16 |
end |
| 17 |
|
| 18 |
def test_WITH_a_route_for_a_namespaced_controller_defined_in_a_plugin_IT_should_route_it |
| 19 |
path = 'somespace/routes/an_action' |
| 20 |
opts = {:controller => 'namespace/test_routing', :action => 'an_action'}
|
| 21 |
assert_routing path, opts |
| 22 |
assert_recognizes opts, path |
| 23 |
end |
| 24 |
|
| 25 |
def test_should_properly_generate_named_routes |
| 26 |
get :test_named_routes_from_plugin |
| 27 |
assert_response_body '/somespace/routes' |
| 28 |
end |
| 29 |
end |