Added test to ensure that we dont break #to_h again when trying to restore the...

Added test to ensure that we dont break #to_h again when trying to restore the speed-up from 26dd9b26 (cc: @fxn)
上级 730300a2
...@@ -140,6 +140,11 @@ def assert_filtered_out(params, key) ...@@ -140,6 +140,11 @@ def assert_filtered_out(params, key)
assert_equal "William Shakespeare", permitted[:book][:authors_attributes]["0"][:name] assert_equal "William Shakespeare", permitted[:book][:authors_attributes]["0"][:name]
assert_equal "Unattributed Assistant", permitted[:book][:authors_attributes]["1"][: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 assert_filtered_out permitted[:book][:authors_attributes]["0"], :age_of_death
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册