aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorHendy Tanata <htanata@gmail.com>2011-10-15 17:20:54 +0800
committerHendy Tanata <htanata@gmail.com>2011-10-29 20:04:33 +0800
commit010622bb989cb9fa3aac600a7fa7bcb894bb081a (patch)
treead4d5e68fe97c43b7725eab6cf86bc20b24e1b9d /railties/test/application
parent1ad9138c009c941f453dcc6a14f308e6da9fb84a (diff)
downloadrails-010622bb989cb9fa3aac600a7fa7bcb894bb081a.tar.gz
rails-010622bb989cb9fa3aac600a7fa7bcb894bb081a.tar.bz2
rails-010622bb989cb9fa3aac600a7fa7bcb894bb081a.zip
On inpsect routes, show :controller and :action to indicate dynamic.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/route_inspect_test.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/railties/test/application/route_inspect_test.rb b/railties/test/application/route_inspect_test.rb
index add8256b5d..78980705ed 100644
--- a/railties/test/application/route_inspect_test.rb
+++ b/railties/test/application/route_inspect_test.rb
@@ -49,12 +49,20 @@ module ApplicationTests
assert_equal ["root / pages#main"], output
end
+ def test_inspect_routes_shows_dynamic_action_route
+ @set.draw do
+ match 'api/:action' => 'api'
+ end
+ output = @inspector.format @set.routes
+ assert_equal [" /api/:action(.:format) api#:action"], output
+ end
+
def test_inspect_routes_shows_controller_and_action_only_route
@set.draw do
match ':controller/:action'
end
output = @inspector.format @set.routes
- assert_equal [" /:controller/:action(.:format) "], output
+ assert_equal [" /:controller/:action(.:format) :controller#:action"], output
end
def test_inspect_routes_shows_controller_and_action_route_with_constraints
@@ -62,7 +70,7 @@ module ApplicationTests
match ':controller(/:action(/:id))', :id => /\d+/
end
output = @inspector.format @set.routes
- assert_equal [" /:controller(/:action(/:id))(.:format) {:id=>/\\d+/}"], output
+ assert_equal [" /:controller(/:action(/:id))(.:format) :controller#:action {:id=>/\\d+/}"], output
end
def test_rake_routes_shows_route_with_defaults