1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Current tests are testing stickiness of non-permitted parameters

This commit is contained in:
Benjamin Quorning 2012-11-06 21:23:24 +01:00
parent 5b3b9b0ebc
commit 93eaffe59b

View file

@ -20,7 +20,7 @@ class ParametersPermitTest < ActiveSupport::TestCase
assert_equal "monkey", @params.fetch(:foo) { "monkey" }
end
test "permitted is sticky on accessors" do
test "not permitted is sticky on accessors" do
assert !@params.slice(:person).permitted?
assert !@params[:person][:name].permitted?
@ -31,12 +31,12 @@ class ParametersPermitTest < ActiveSupport::TestCase
assert !@params.values_at(:person).first.permitted?
end
test "permitted is sticky on mutators" do
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?
end
test "permitted is sticky beyond merges" do
test "not permitted is sticky beyond merges" do
assert !@params.merge(a: "b").permitted?
end