diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-01-12 17:38:22 -0200 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-01-12 17:38:22 -0200 |
commit | 858b9652ced5438127e6c6404bf3f9cae9699985 (patch) | |
tree | 1fbe5216c059aadf914bbb755d95723eeb723efa /actionpack/test | |
parent | 64448c29deb2f7239ac7e21035c05b8793ee1f47 (diff) | |
parent | 22288603645c95751f64245fc89fc259a27ad94c (diff) | |
download | rails-858b9652ced5438127e6c6404bf3f9cae9699985.tar.gz rails-858b9652ced5438127e6c6404bf3f9cae9699985.tar.bz2 rails-858b9652ced5438127e6c6404bf3f9cae9699985.zip |
Merge pull request #23034 from claudiob/fix-ac-param-as-json
AC::Parameters#at_json: restore Rails 4.2’s value
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/accessors_test.rb | 6 |
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" } |