aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-02-18 23:52:28 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-02-18 23:52:28 +0000
commit519fe7ccbc5798aa957e9a8ea146bb825cd79b9e (patch)
tree2d32e9e84eece6ec19053cb41771366833fb27be /actionpack/test
parent7a67d0f617db7d2962b6c3b80466e21570b244bf (diff)
downloadrails-519fe7ccbc5798aa957e9a8ea146bb825cd79b9e.tar.gz
rails-519fe7ccbc5798aa957e9a8ea146bb825cd79b9e.tar.bz2
rails-519fe7ccbc5798aa957e9a8ea146bb825cd79b9e.zip
Added URL escaping for routing #664
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/routing_tests.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/routing_tests.rb b/actionpack/test/controller/routing_tests.rb
index 821e66af70..69632c694f 100644
--- a/actionpack/test/controller/routing_tests.rb
+++ b/actionpack/test/controller/routing_tests.rb
@@ -278,6 +278,18 @@ class RouteTests < Test::Unit::TestCase
assert_equal Controllers::Admin::UserController, controller
assert_equal %w{action id}, leftovers
end
+
+ def test_special_characters
+ route ':id', :controller => 'content', :action => 'fish'
+ verify_recognize'id+with+spaces',
+ :controller => 'content', :action => 'fish', :id => 'id with spaces'
+ verify_generate('id+with+spaces', {},
+ {:controller => 'content', :action => 'fish', :id => 'id with spaces'}, {})
+ verify_recognize 'id%2Fwith%2Fslashes',
+ :controller => 'content', :action => 'fish', :id => 'id/with/slashes'
+ verify_generate('id%2Fwith%2Fslashes', {},
+ {:controller => 'content', :action => 'fish', :id => 'id/with/slashes'}, {})
+ end
end
class RouteSetTests < Test::Unit::TestCase