aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/params_wrapper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/params_wrapper_test.rb')
-rw-r--r--actionpack/test/controller/params_wrapper_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/params_wrapper_test.rb b/actionpack/test/controller/params_wrapper_test.rb
index faa57c4559..1eb92abae4 100644
--- a/actionpack/test/controller/params_wrapper_test.rb
+++ b/actionpack/test/controller/params_wrapper_test.rb
@@ -35,6 +35,10 @@ class ParamsWrapperTest < ActionController::TestCase
end
class Person
+ def self.stores_attributes
+ { settings: [:color, :size] }
+ end
+
def self.attribute_names
[]
end
@@ -62,6 +66,15 @@ class ParamsWrapperTest < ActionController::TestCase
end
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" })
+ end
+ end
+
def test_specify_wrapper_name
with_default_wrapper_options do
UsersController.wrap_parameters :person