aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/parameters
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2017-01-18 16:09:58 +0900
committerAkira Matsuda <ronnie@dio.jp>2017-01-18 17:30:46 +0900
commit5349d4ee080ff6da892081eae871a195847353c1 (patch)
tree60c6ebacfc509551b8eadb5ed74a5f66791cd200 /actionpack/test/controller/parameters
parent044f8bdf625dae78e4e230b9c61d9881864e2def (diff)
downloadrails-5349d4ee080ff6da892081eae871a195847353c1.tar.gz
rails-5349d4ee080ff6da892081eae871a195847353c1.tar.bz2
rails-5349d4ee080ff6da892081eae871a195847353c1.zip
:warning: "Use assert_nil if expecting nil. This will fail in MT6."
These are followups for 307065f959f2b34bdad16487bae906eb3bfeaf28, but TBH I'm personally not very much confortable with this style. Maybe we could override assert_equal in our test_helper not to warn?
Diffstat (limited to 'actionpack/test/controller/parameters')
-rw-r--r--actionpack/test/controller/parameters/parameters_permit_test.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb
index 82d7530e9f..8920914af1 100644
--- a/actionpack/test/controller/parameters/parameters_permit_test.rb
+++ b/actionpack/test/controller/parameters/parameters_permit_test.rb
@@ -66,12 +66,20 @@ class ParametersPermitTest < ActiveSupport::TestCase
values.each do |value|
params = ActionController::Parameters.new(id: value)
permitted = params.permit(:id)
- assert_equal value, permitted[:id]
+ if value.nil?
+ assert_nil permitted[:id]
+ else
+ assert_equal value, permitted[:id]
+ end
@struct_fields.each do |sf|
params = ActionController::Parameters.new(sf => value)
permitted = params.permit(:sf)
- assert_equal value, permitted[sf]
+ if value.nil?
+ assert_nil permitted[sf]
+ else
+ assert_equal value, permitted[sf]
+ end
end
end
end