diff options
author | Prem Sichanugrist <s@sikac.hu> | 2014-08-18 20:39:00 -0400 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2014-08-18 20:42:46 -0400 |
commit | 3591dd59e0d5b3e99c1f54619dd78aa7dbba374e (patch) | |
tree | def285bf887d53ce54047895055837733b510de2 /actionpack/test/controller | |
parent | 0663e8f1796c8a26c9823ac062420aac267aee16 (diff) | |
download | rails-3591dd59e0d5b3e99c1f54619dd78aa7dbba374e.tar.gz rails-3591dd59e0d5b3e99c1f54619dd78aa7dbba374e.tar.bz2 rails-3591dd59e0d5b3e99c1f54619dd78aa7dbba374e.zip |
Fix failing test on several methods on Parameter
* `each`
* `each_pair`
* `delete`
* `select!`
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/parameters/accessors_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/controller/parameters/mutators_test.rb | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/test/controller/parameters/accessors_test.rb b/actionpack/test/controller/parameters/accessors_test.rb index 7f4e595330..97875c3cbb 100644 --- a/actionpack/test/controller/parameters/accessors_test.rb +++ b/actionpack/test/controller/parameters/accessors_test.rb @@ -36,6 +36,15 @@ class ParametersAccessorsTest < ActiveSupport::TestCase @params.each { |key, value| assert_not(value.permitted?) if key == "person" } end + test "each_pair carries permitted status" do + @params.permit! + @params.each_pair { |key, value| assert(value.permitted?) if key == "person" } + end + + test "each_pair carries unpermitted status" do + @params.each_pair { |key, value| assert_not(value.permitted?) if key == "person" } + end + test "except retains permitted status" do @params.permit! assert @params.except(:person).permitted? diff --git a/actionpack/test/controller/parameters/mutators_test.rb b/actionpack/test/controller/parameters/mutators_test.rb index 300dbfa61c..744d8664be 100644 --- a/actionpack/test/controller/parameters/mutators_test.rb +++ b/actionpack/test/controller/parameters/mutators_test.rb @@ -63,11 +63,11 @@ class ParametersMutatorsTest < ActiveSupport::TestCase test "select! retains permitted status" do @params.permit! - assert @params.select! { |k| k == "person" }.permitted? + assert @params.select! { |k| k != "person" }.permitted? end test "select! retains unpermitted status" do - assert_not @params.select! { |k| k == "person" }.permitted? + assert_not @params.select! { |k| k != "person" }.permitted? end test "slice! retains permitted status" do |