Actions
Refactor #18665
closedForeman::Controller::Parameters tests should ignore hash/AC::Parameters differences
Description
Under Rails 5.0, the ActionController::Parameters class no longer inherits from Hash and is now its own class that delegates some methods to an internal Hash.
This causes failures in tests for the Foreman::Controller::Parameters::* concerns which have equality assertions on AC::Parameters and hashes, to check the expected filtered output, e.g.
--- expected +++ actual @@ -1 +1 @@ -{"plugin_ext"=>"b"} +<ActionController::Parameters {"plugin_ext"=>"b"} permitted: true>
AC::Parameters has a #to_h method that returns a hash (in both 4.2 and 5.0), so these tests can trivially be updated to call #to_h before comparing the filtered object to a hash.
Actions