Skip to content

Commit

Permalink
Add test case to make sure we can implicit convert a Parameters to a …
Browse files Browse the repository at this point in the history
…Hash
  • Loading branch information
rafaelfranca committed Apr 21, 2017
1 parent 06580a4 commit d766e3d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d766e3d

Please sign in to comment.