aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/action_dispatch
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-03-22 22:19:31 +0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-03-22 09:19:40 -0700
commit2ddfdba9a0dab7d8499c3ad0d13583bddbac4f69 (patch)
treedd3ea564ad557d83227355616aabd0eb18b1aa92 /actionpack/test/action_dispatch
parent15d3cc21f41af4b3caaae4f3586481effa77058f (diff)
downloadrails-2ddfdba9a0dab7d8499c3ad0d13583bddbac4f69.tar.gz
rails-2ddfdba9a0dab7d8499c3ad0d13583bddbac4f69.tar.bz2
rails-2ddfdba9a0dab7d8499c3ad0d13583bddbac4f69.zip
Do not show optional (.:format) block for wildcard route [#6605 state:resolved]
This will make the output of `rake routes` to be correctly match to the behavior of the application, as the regular expression used to match the path is greedy and won't capture the format part by default
Diffstat (limited to 'actionpack/test/action_dispatch')
-rw-r--r--actionpack/test/action_dispatch/routing/mapper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/action_dispatch/routing/mapper_test.rb b/actionpack/test/action_dispatch/routing/mapper_test.rb
index 9966234f1b..e21b271907 100644
--- a/actionpack/test/action_dispatch/routing/mapper_test.rb
+++ b/actionpack/test/action_dispatch/routing/mapper_test.rb
@@ -46,6 +46,13 @@ module ActionDispatch
mapper.match '/one/two/', :to => 'posts#index', :as => :main
assert_equal '/one/two(.:format)', fakeset.conditions.first[:path_info]
end
+
+ def test_map_wildcard
+ fakeset = FakeSet.new
+ mapper = Mapper.new fakeset
+ mapper.match '/*path', :to => 'pages#show', :as => :page
+ assert_equal '/*path', fakeset.conditions.first[:path_info]
+ end
end
end
end