aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/testing/test_case.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-10-19 23:32:06 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-19 23:32:17 -0500
commita1df2590744ed126981dfd5b5709ff6fd5dc6476 (patch)
tree1c01e2ba7465f554a2470155c46c0309dfe7615f /actionpack/lib/action_controller/testing/test_case.rb
parentcbedcb06152ed6d7e7457334cd45af5ab24ef6ea (diff)
downloadrails-a1df2590744ed126981dfd5b5709ff6fd5dc6476.tar.gz
rails-a1df2590744ed126981dfd5b5709ff6fd5dc6476.tar.bz2
rails-a1df2590744ed126981dfd5b5709ff6fd5dc6476.zip
Replace decaying routing internals w/ rack-mount
Diffstat (limited to 'actionpack/lib/action_controller/testing/test_case.rb')
-rw-r--r--actionpack/lib/action_controller/testing/test_case.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/testing/test_case.rb b/actionpack/lib/action_controller/testing/test_case.rb
index 178e3477a6..01a55fe930 100644
--- a/actionpack/lib/action_controller/testing/test_case.rb
+++ b/actionpack/lib/action_controller/testing/test_case.rb
@@ -10,6 +10,13 @@ module ActionController
self.session_options = TestSession::DEFAULT_OPTIONS.merge(:id => ActiveSupport::SecureRandom.hex(16))
end
+ class Result < ::Array #:nodoc:
+ def to_s() join '/' end
+ def self.new_escaped(strings)
+ new strings.collect {|str| URI.unescape str}
+ end
+ end
+
def assign_parameters(controller_path, action, parameters = {})
parameters = parameters.symbolize_keys.merge(:controller => controller_path, :action => action)
extra_keys = ActionController::Routing::Routes.extra_keys(parameters)
@@ -18,7 +25,7 @@ module ActionController
if value.is_a? Fixnum
value = value.to_s
elsif value.is_a? Array
- value = ActionController::Routing::PathSegment::Result.new(value)
+ value = Result.new(value)
end
if extra_keys.include?(key.to_sym)