diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-26 16:04:29 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-26 16:04:29 -0700 |
commit | 3f632027819ab331187ca58c014458dfcfd57a89 (patch) | |
tree | 935c3d13f571315ee168d5a8853c14dd3a3c0925 /actionpack/lib/action_dispatch | |
parent | c9d9bd7227b687f2162bd485b891aa2c2499adf0 (diff) | |
download | rails-3f632027819ab331187ca58c014458dfcfd57a89.tar.gz rails-3f632027819ab331187ca58c014458dfcfd57a89.tar.bz2 rails-3f632027819ab331187ca58c014458dfcfd57a89.zip |
Don't assume :params is a Hash
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/test/mock.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/test/mock.rb b/actionpack/lib/action_dispatch/test/mock.rb index 86269fad01..8dc048af11 100644 --- a/actionpack/lib/action_dispatch/test/mock.rb +++ b/actionpack/lib/action_dispatch/test/mock.rb @@ -21,10 +21,7 @@ module ActionDispatch if method == "POST" && !opts.has_key?(:input) opts["CONTENT_TYPE"] = "application/x-www-form-urlencoded" - multipart = (opts[:params] || {}).any? do |k, v| - UploadedFile === v - end - + multipart = opts[:params].respond_to?(:any?) && opts[:params].any? { |k, v| UploadedFile === v } if multipart opts[:input] = multipart_body(opts.delete(:params)) opts["CONTENT_LENGTH"] ||= opts[:input].length.to_s |