diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-01-16 14:08:48 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2017-01-16 14:08:48 +0100 |
commit | f5d66cb3e5fc48c89c41c522804b70f3e5fcbc47 (patch) | |
tree | dcf1902d6171ca5c75a1708f802434c8fc3a80e7 /actionpack/test/controller/parameters | |
parent | 730300a2602e4e6874de56194b79e3e5e474960e (diff) | |
download | rails-f5d66cb3e5fc48c89c41c522804b70f3e5fcbc47.tar.gz rails-f5d66cb3e5fc48c89c41c522804b70f3e5fcbc47.tar.bz2 rails-f5d66cb3e5fc48c89c41c522804b70f3e5fcbc47.zip |
Added test to ensure that we dont break #to_h again when trying to restore the speed-up from 26dd9b26ab7317f94fd285245879e888344143b2 (cc: @fxn)
Diffstat (limited to 'actionpack/test/controller/parameters')
-rw-r--r-- | actionpack/test/controller/parameters/nested_parameters_permit_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/nested_parameters_permit_test.rb b/actionpack/test/controller/parameters/nested_parameters_permit_test.rb index 5f86901e30..138d83726c 100644 --- a/actionpack/test/controller/parameters/nested_parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/nested_parameters_permit_test.rb @@ -140,6 +140,11 @@ class NestedParametersPermitTest < ActiveSupport::TestCase assert_equal "William Shakespeare", permitted[:book][:authors_attributes]["0"][:name] assert_equal "Unattributed Assistant", permitted[:book][:authors_attributes]["1"][:name] + assert_equal( + {"book"=>{"authors_attributes"=>{"0"=>{"name"=>"William Shakespeare"}, "1"=>{"name"=>"Unattributed Assistant"}, "2"=>{}}}}, + permitted.to_h + ) + assert_filtered_out permitted[:book][:authors_attributes]["0"], :age_of_death end |