1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Rafael Mendonça França 2017-04-20 22:33:36 -04:00
parent 06580a4f97
commit d766e3dc5d
No known key found for this signature in database
GPG key ID: FC23B6D0F1EEE948

View file

@ -416,6 +416,13 @@ class ParametersPermitTest < ActiveSupport::TestCase
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