From f5d66cb3e5fc48c89c41c522804b70f3e5fcbc47 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 16 Jan 2017 14:08:48 +0100 Subject: Added test to ensure that we dont break #to_h again when trying to restore the speed-up from 26dd9b26ab7317f94fd285245879e888344143b2 (cc: @fxn) --- .../test/controller/parameters/nested_parameters_permit_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack') 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 -- cgit v1.2.3