diff options
-rw-r--r-- | actionpack/test/controller/params_wrapper_test.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/actionpack/test/controller/params_wrapper_test.rb b/actionpack/test/controller/params_wrapper_test.rb index 1eb92abae4..2a41d57b26 100644 --- a/actionpack/test/controller/params_wrapper_test.rb +++ b/actionpack/test/controller/params_wrapper_test.rb @@ -32,13 +32,13 @@ class ParamsWrapperTest < ActionController::TestCase def self.attribute_names [] end - end - class Person - def self.stores_attributes + def self.stored_attributes { settings: [:color, :size] } end + end + class Person def self.attribute_names [] end @@ -67,11 +67,13 @@ class ParamsWrapperTest < ActionController::TestCase end def test_store_accessors_wrapped - with_default_wrapper_options do - @request.env["CONTENT_TYPE"] = "application/json" - post :parse, params: { "username" => "sikachu", "color" => "blue", "size" => "large" } - assert_parameters("username" => "sikachu", "color" => "blue", "size" => "large", - "user" => { "username" => "sikachu", "color" => "blue", "size" => "large" }) + assert_called(User, :attribute_names, times: 2, returns: ["username"]) do + with_default_wrapper_options do + @request.env["CONTENT_TYPE"] = "application/json" + post :parse, params: { "username" => "sikachu", "color" => "blue", "size" => "large" } + assert_parameters("username" => "sikachu", "color" => "blue", "size" => "large", + "user" => { "username" => "sikachu", "color" => "blue", "size" => "large" }) + end end end |