diff options
author | Bogdan <bogdanvlviv@gmail.com> | 2018-10-15 15:28:15 +0300 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-15 21:28:15 +0900 |
commit | 6fe45f378ab7bc88fecb99576fa367f83b3255f3 (patch) | |
tree | cf74727d60ac74a8d4873d1384aba4ebc46aae8c /actionpack/test | |
parent | 777cc1da7d3ecca3f669976b47310f362e2bc8a4 (diff) | |
download | rails-6fe45f378ab7bc88fecb99576fa367f83b3255f3.tar.gz rails-6fe45f378ab7bc88fecb99576fa367f83b3255f3.tar.bz2 rails-6fe45f378ab7bc88fecb99576fa367f83b3255f3.zip |
Fix `ActionController::Parameters#each_value` and add changelog entry to this method (#34210)
* Fix `ActionController::Parameters#each_value`
`each_value` should yield with "value" of the params instead of "value" as an array.
Related to #33979
* Add changelog entry about `ActionController::Parameters#each_value`.
Follow up #33979
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/accessors_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/test/controller/parameters/accessors_test.rb b/actionpack/test/controller/parameters/accessors_test.rb index 9f1fb3d042..7789e654d5 100644 --- a/actionpack/test/controller/parameters/accessors_test.rb +++ b/actionpack/test/controller/parameters/accessors_test.rb @@ -77,11 +77,15 @@ class ParametersAccessorsTest < ActiveSupport::TestCase test "each_value carries permitted status" do @params.permit! - @params["person"].each_value { |value| assert(value.permitted?) if value == 32 } + @params.each_value do |value| + assert_predicate(value, :permitted?) + end end test "each_value carries unpermitted status" do - @params["person"].each_value { |value| assert_not(value.permitted?) if value == 32 } + @params.each_value do |value| + assert_not_predicate(value, :permitted?) + end end test "each_key converts to hash for permitted" do |