aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-06-30 20:47:26 +0200
committerXavier Noria <fxn@hashref.com>2010-06-30 20:47:26 +0200
commitc63cf7bf0db708fe46a929cf57649ab5a92034af (patch)
tree8f0974852b51597652e6ae73da26f3eb80fe878b /actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
parent52c56f9f7ec46ee39f1a6319ff4017e2492683ed (diff)
parentb07e6fdaa0aa07016d1425ada5b7f966142d0212 (diff)
downloadrails-c63cf7bf0db708fe46a929cf57649ab5a92034af.tar.gz
rails-c63cf7bf0db708fe46a929cf57649ab5a92034af.tar.bz2
rails-c63cf7bf0db708fe46a929cf57649ab5a92034af.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb')
-rw-r--r--actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
index 69dbd7f528..0bcef81534 100644
--- a/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
+++ b/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
@@ -141,6 +141,29 @@ class UrlEncodedParamsParsingTest < ActionController::IntegrationTest
post "/parse", actual
assert_response :ok
assert_equal(expected, TestController.last_request_parameters)
+ assert_utf8(TestController.last_request_parameters)
+ end
+ end
+
+ def assert_utf8(object)
+ return unless "ruby".encoding_aware?
+
+ correct_encoding = Encoding.default_internal
+
+ unless object.is_a?(Hash)
+ assert_equal correct_encoding, object.encoding, "#{object.inspect} should have been UTF-8"
+ return
+ end
+
+ object.each do |k,v|
+ case v
+ when Hash
+ assert_utf8(v)
+ when Array
+ v.each {|el| assert_utf8(el) }
+ else
+ assert_utf8(v)
+ end
end
end
end