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:
parent
06580a4f97
commit
d766e3dc5d
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue