aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2016-01-19 11:53:27 -0600
committerschneems <richard.schneeman@gmail.com>2016-01-19 12:06:29 -0600
commit3f2ac413b7c455ca951944da510683f52cb964da (patch)
treed470e982c9e9b2cb965b658ba8417b9330dfea19 /actionpack/test
parent66d705b3e7c03f806f7481e0e6a1f157dcf86f83 (diff)
downloadrails-3f2ac413b7c455ca951944da510683f52cb964da.tar.gz
rails-3f2ac413b7c455ca951944da510683f52cb964da.tar.bz2
rails-3f2ac413b7c455ca951944da510683f52cb964da.zip
Add methods to StrongParameters
It's reasonable to expose different value readers.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/required_params_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/test/controller/required_params_test.rb b/actionpack/test/controller/required_params_test.rb
index 129a713564..b6efcd6f9a 100644
--- a/actionpack/test/controller/required_params_test.rb
+++ b/actionpack/test/controller/required_params_test.rb
@@ -66,7 +66,14 @@ class ParametersRequireTest < ActiveSupport::TestCase
end
end
- test "Deprecated method are deprecated" do
+ test "value params" do
+ params = ActionController::Parameters.new(foo: "bar", dog: "cinco")
+ assert_equal ["bar", "cinco"], params.values
+ assert params.has_value?("cinco")
+ assert params.value?("cinco")
+ end
+
+ test "Deprecated methods are deprecated" do
assert_deprecated do
ActionController::Parameters.new(foo: "bar").merge!({bar: "foo"})
end