From 519fe7ccbc5798aa957e9a8ea146bb825cd79b9e Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 18 Feb 2005 23:52:28 +0000 Subject: Added URL escaping for routing #664 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/routing_tests.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/controller') 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 -- cgit v1.2.3