diff options
author | Jesús García Sáez <blaxter@gmail.com> | 2009-06-23 22:54:32 +0200 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-07-02 12:18:48 -0700 |
commit | fc6077d76ecbf20d29e9963afcabfd613d839091 (patch) | |
tree | b602f496778197890eeac8c19c2a39b5bcdd0c45 /actionpack/test/controller | |
parent | 0fbf458b6c7992a1626282727a70636af19450d5 (diff) | |
download | rails-fc6077d76ecbf20d29e9963afcabfd613d839091.tar.gz rails-fc6077d76ecbf20d29e9963afcabfd613d839091.tar.bz2 rails-fc6077d76ecbf20d29e9963afcabfd613d839091.zip |
Allow symbols on routes declaration (:controller and :action values) [#2828 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 16d7df4843..fb83dba395 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -2492,6 +2492,16 @@ class RouteSetTest < Test::Unit::TestCase end assert_equal({:controller => 'pages', :action => 'show', :name => 'JAMIS'}, set.recognize_path('/page/JAMIS')) end + + def test_routes_with_symbols + set.draw do |map| + map.connect 'unnamed', :controller => :pages, :action => :show, :name => :as_symbol + map.named 'named', :controller => :pages, :action => :show, :name => :as_symbol + end + assert_equal({:controller => 'pages', :action => 'show', :name => :as_symbol}, set.recognize_path('/unnamed')) + assert_equal({:controller => 'pages', :action => 'show', :name => :as_symbol}, set.recognize_path('/named')) + end + end class RouteLoadingTest < Test::Unit::TestCase |