aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorDavid Chelimsky <dchelimsky@gmail.com>2011-05-22 08:11:54 -0400
committerDavid Chelimsky <dchelimsky@gmail.com>2011-05-22 08:13:22 -0400
commit3f0c71c8524856c32bc056bdb38136b3d18f2aaf (patch)
tree48391f55a1ac05dfbe74bd3bc43a7e6544ca2bb3 /actionpack/lib/action_controller
parent9277e72a3ca1009f135b1eb194ff6f3c96a55c1b (diff)
downloadrails-3f0c71c8524856c32bc056bdb38136b3d18f2aaf.tar.gz
rails-3f0c71c8524856c32bc056bdb38136b3d18f2aaf.tar.bz2
rails-3f0c71c8524856c32bc056bdb38136b3d18f2aaf.zip
use to_param (and change method to name accordingly)
- exclude Rack::Test::UploadedFile to pass existing tests. Are there any other types we're missing?
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/test_case.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 9c1f77ec91..639e24c995 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -395,25 +395,25 @@ module ActionController
end
alias xhr :xml_http_request
- def stringify_values(hash_or_array_or_value)
+ def paramify_values(hash_or_array_or_value)
case hash_or_array_or_value
when Hash
hash_or_array_or_value.each do |key, value|
- hash_or_array_or_value[key] = stringify_values(value)
+ hash_or_array_or_value[key] = paramify_values(value)
end
when Array
- hash_or_array_or_value.map {|i| stringify_values(i)}
- when Numeric, Symbol
- hash_or_array_or_value.to_s
- else
+ hash_or_array_or_value.map {|i| paramify_values(i)}
+ when Rack::Test::UploadedFile
hash_or_array_or_value
+ else
+ hash_or_array_or_value.to_param
end
end
def process(action, parameters = nil, session = nil, flash = nil, http_method = 'GET')
# Ensure that numbers and symbols passed as params are converted to
- # strings, as is the case when engaging rack.
- stringify_values(parameters)
+ # proper params, as is the case when engaging rack.
+ paramify_values(parameters)
# Sanity check for required instance variables so we can give an
# understandable error message.