Add test case to make sure we can implicit convert a Parameters to a Hash

上级 06580a4f
......@@ -416,6 +416,13 @@ def walk_permitted(params)
assert_not_kind_of ActionController::Parameters, @params.to_hash
end
test "parameters can be implicit converted to Hash" do
params = ActionController::Parameters.new
params.permit!
assert_equal({ a: 1 }, { a: 1 }.merge!(params))
end
test "to_hash returns converted hash when .permit_all_parameters is set" do
begin
ActionController::Parameters.permit_all_parameters = true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册