aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/parameters
diff options
context:
space:
mode:
authorclaudiob <claudiob@gmail.com>2016-01-12 10:27:29 -0800
committerclaudiob <claudiob@gmail.com>2016-01-12 10:27:29 -0800
commit22288603645c95751f64245fc89fc259a27ad94c (patch)
treef1e7d06c17de6e1702e2f28a94fcfd7e9e66f808 /actionpack/test/controller/parameters
parentf718e52bcce02bc137263ead3a9d9f5df1c42c37 (diff)
downloadrails-22288603645c95751f64245fc89fc259a27ad94c.tar.gz
rails-22288603645c95751f64245fc89fc259a27ad94c.tar.bz2
rails-22288603645c95751f64245fc89fc259a27ad94c.zip
AC::Parameters#at_json: restore Rails 4.2’s value
Fixes #23026 See discussion at #23026
Diffstat (limited to 'actionpack/test/controller/parameters')
-rw-r--r--actionpack/test/controller/parameters/accessors_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/accessors_test.rb b/actionpack/test/controller/parameters/accessors_test.rb
index 97875c3cbb..a8f4d877a6 100644
--- a/actionpack/test/controller/parameters/accessors_test.rb
+++ b/actionpack/test/controller/parameters/accessors_test.rb
@@ -27,6 +27,12 @@ class ParametersAccessorsTest < ActiveSupport::TestCase
assert_not @params[:person][:name].permitted?
end
+ test "as_json returns the JSON representation of the parameters hash" do
+ assert_not @params.as_json.key? "parameters"
+ assert_not @params.as_json.key? "permitted"
+ assert @params.as_json.key? "person"
+ end
+
test "each carries permitted status" do
@params.permit!
@params.each { |key, value| assert(value.permitted?) if key == "person" }