class AnonymousControllerParamsWrapperTest

Attributes

last_parameters[RW]

Public Instance Methods

parse() click to toggle source
# File actionpack/test/controller/params_wrapper_test.rb, line 339
def parse
  self.class.last_parameters = request.params.except(:controller, :action)
  head :ok
end
test_does_not_implicitly_wrap_params() click to toggle source
# File actionpack/test/controller/params_wrapper_test.rb, line 345
def test_does_not_implicitly_wrap_params
  with_default_wrapper_options do
    @request.env["CONTENT_TYPE"] = "application/json"
    post :parse, params: { "username" => "sikachu" }
    assert_parameters("username" => "sikachu")
  end
end
test_does_wrap_params_if_name_provided() click to toggle source
# File actionpack/test/controller/params_wrapper_test.rb, line 353
def test_does_wrap_params_if_name_provided
  with_default_wrapper_options do
    @controller.class.wrap_parameters(name: "guest")
    @request.env["CONTENT_TYPE"] = "application/json"
    post :parse, params: { "username" => "sikachu" }
    assert_parameters("username" => "sikachu", "guest" => { "username" => "sikachu" })
  end
end