diff options
author | Benjamin Quorning <benjamin@quorning.net> | 2016-02-17 13:35:55 +0100 |
---|---|---|
committer | Benjamin Quorning <benjamin@quorning.net> | 2016-02-17 14:01:14 +0100 |
commit | a62344262327dca1fde6de951616ae656245ad8a (patch) | |
tree | d9a6bfec6892402bfcaf2064bdbb5a4318c9758e /actionpack/test | |
parent | 39b1dd1c3da8465aa033509f13a614e16b7383ae (diff) | |
download | rails-a62344262327dca1fde6de951616ae656245ad8a.tar.gz rails-a62344262327dca1fde6de951616ae656245ad8a.tar.bz2 rails-a62344262327dca1fde6de951616ae656245ad8a.zip |
Implement ActionController::Parameters#inspect
Now that AC::Parameters is no longer a Hash, it shouldn't look like a hash.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/parameters/accessors_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/controller/parameters/accessors_test.rb b/actionpack/test/controller/parameters/accessors_test.rb index bd43ff7697..08b3d81bf0 100644 --- a/actionpack/test/controller/parameters/accessors_test.rb +++ b/actionpack/test/controller/parameters/accessors_test.rb @@ -134,4 +134,13 @@ class ParametersAccessorsTest < ActiveSupport::TestCase params1 = ActionController::Parameters.new(hash1) assert(params1 == hash1) end + + test "inspect shows both class name and parameters" do + assert_equal( + '<ActionController::Parameters {"person"=>{"age"=>"32", '\ + '"name"=>{"first"=>"David", "last"=>"Heinemeier Hansson"}, ' \ + '"addresses"=>[{"city"=>"Chicago", "state"=>"Illinois"}]}}>', + @params.inspect + ) + end end |