aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-04 18:29:31 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-04 18:29:31 -0300
commitb4b0d9d1c1b2c0012dbd5186341b3def2e2c9052 (patch)
treea750781b9581d322cc33534c85b1336b424408c0 /activesupport/test/core_ext/object
parentcf0dc18ac34f45f0fd0aa231c0e59c994691d90f (diff)
parent41bbac6ff4d161fc94ef2dc601e06f0a2779dbaf (diff)
downloadrails-b4b0d9d1c1b2c0012dbd5186341b3def2e2c9052.tar.gz
rails-b4b0d9d1c1b2c0012dbd5186341b3def2e2c9052.tar.bz2
rails-b4b0d9d1c1b2c0012dbd5186341b3def2e2c9052.zip
Merge pull request #14949 from bogdan/empty-hash-array-parameterization
[Fixes #14948] Hash#to_query: right serialization for empty hash and array
Diffstat (limited to 'activesupport/test/core_ext/object')
-rw-r--r--activesupport/test/core_ext/object/to_query_test.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activesupport/test/core_ext/object/to_query_test.rb b/activesupport/test/core_ext/object/to_query_test.rb
index f887a9e613..7457c4655a 100644
--- a/activesupport/test/core_ext/object/to_query_test.rb
+++ b/activesupport/test/core_ext/object/to_query_test.rb
@@ -49,13 +49,15 @@ class ToQueryTest < ActiveSupport::TestCase
def test_nested_empty_hash
assert_equal '',
{}.to_query
- assert_query_equal 'a=1&b%5Bc%5D=3&b%5Bd%5D=',
+ assert_query_equal 'a=1&b%5Bc%5D=3',
{ a: 1, b: { c: 3, d: {} } }
+ assert_query_equal '',
+ { a: {b: {c: {}}} }
assert_query_equal 'b%5Bc%5D=false&b%5Be%5D=&b%5Bf%5D=&p=12',
{ p: 12, b: { c: false, e: nil, f: '' } }
- assert_query_equal 'b%5Bc%5D=3&b%5Bf%5D=&b%5Bk%5D=',
+ assert_query_equal 'b%5Bc%5D=3&b%5Bf%5D=',
{ b: { c: 3, k: {}, f: '' } }
- assert_query_equal 'a%5B%5D=&b=3',
+ assert_query_equal 'b=3',
{a: [], b: 3}
end