diff options
Diffstat (limited to 'actionpack/test/controller/parameters/parameters_permit_test.rb')
-rw-r--r-- | actionpack/test/controller/parameters/parameters_permit_test.rb | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb index b9d2145eb4..ba98ad7605 100644 --- a/actionpack/test/controller/parameters/parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/parameters_permit_test.rb @@ -1,7 +1,6 @@ require 'abstract_unit' require 'action_dispatch/http/upload' require 'action_controller/metal/strong_parameters' -require 'active_support/core_ext/hash/transform_values' class ParametersPermitTest < ActiveSupport::TestCase def assert_filtered_out(params, key) @@ -195,62 +194,6 @@ class ParametersPermitTest < ActiveSupport::TestCase assert_equal "monkey", @params.fetch(:foo) { "monkey" } end - test "not permitted is sticky on accessors" do - assert !@params.slice(:person).permitted? - assert !@params[:person][:name].permitted? - assert !@params[:person].except(:name).permitted? - - @params.each { |key, value| assert(!value.permitted?) if key == "person" } - - assert !@params.fetch(:person).permitted? - - assert !@params.values_at(:person).first.permitted? - - assert !@params.transform_keys { |k| k }.permitted? - assert !@params.transform_values { |v| v }.permitted? - end - - test "permitted is sticky on accessors" do - @params.permit! - assert @params.slice(:person).permitted? - assert @params[:person][:name].permitted? - assert @params[:person].except(:name).permitted? - - @params.each { |key, value| assert(value.permitted?) if key == "person" } - - assert @params.fetch(:person).permitted? - - assert @params.values_at(:person).first.permitted? - - assert @params.transform_keys { |k| k }.permitted? - assert @params.transform_values { |v| v }.permitted? - end - - test "not permitted is sticky on mutators" do - assert !@params.delete_if { |k| k == "person" }.permitted? - assert !@params.keep_if { |k,v| k == "person" }.permitted? - - assert !@params.slice!(:person).permitted? - - assert !@params.extract!(:person).permitted? - - assert !@params.transform_keys! { |k| k }.permitted? - assert !@params.transform_values! { |v| v }.permitted? - end - - test "permitted is sticky on mutators" do - @params.permit! - assert @params.delete_if { |k| k == "person" }.permitted? - assert @params.keep_if { |k,v| k == "person" }.permitted? - - assert @params.slice!(:person).permitted? - - assert @params.extract!(:person).permitted? - - assert @params.transform_keys! { |k| k }.permitted? - assert @params.transform_values! { |v| v }.permitted? - end - test "not permitted is sticky beyond merges" do assert !@params.merge(a: "b").permitted? end |