diff options
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 |