aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-06-05 15:30:09 +0000
committerJamis Buck <jamis@37signals.com>2006-06-05 15:30:09 +0000
commit149f5cad856f14b53780619a3efc0258cdd4759b (patch)
treed8fa0449c888c57928acbf653e6f3f676be652db /actionpack/test
parent2ffc84d23ff8f78bf43b277d64a4bcda51e932fc (diff)
downloadrails-149f5cad856f14b53780619a3efc0258cdd4759b.tar.gz
rails-149f5cad856f14b53780619a3efc0258cdd4759b.tar.bz2
rails-149f5cad856f14b53780619a3efc0258cdd4759b.zip
Escape the entire path before trying to recognize it (closes #3671)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4436 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/routing_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index acbf226a8c..62bad1fee3 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -1207,6 +1207,15 @@ class RouteSetTest < Test::Unit::TestCase
end
end
+ def test_recognize_with_encoded_id_and_regex
+ set.draw do |map|
+ map.connect 'page/:id', :controller => 'pages', :action => 'show', :id => /[a-zA-Z0-9 ]+/
+ end
+
+ assert_equal({:controller => 'pages', :action => 'show', :id => '10'}, set.recognize_path('/page/10'))
+ assert_equal({:controller => 'pages', :action => 'show', :id => 'hello world'}, set.recognize_path('/page/hello+world'))
+ end
+
def test_recognize_with_conditions
Object.const_set(:PeopleController, Class.new)