From 8c9e4d520291871e5319bc0e0a890527d8aea099 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist <s@sikachu.com> Date: Thu, 28 Apr 2011 15:56:11 +0700 Subject: Add `ActionController::ParamsWrapper` to wrap parameters into a nested hash This will allow us to do a rootless JSON/XML request to server. --- railties/test/application/configuration_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'railties/test') diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index ab3eb4c9e7..8f96f4c57b 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -432,5 +432,15 @@ module ApplicationTests get "/" assert_equal 'true', last_response.body end + + test "config.action_controller.wrap_parameters is set in ActionController::Base" do + app_file 'config/initializers/wrap_parameters.rb', <<-RUBY + ActionController::Base.wrap_parameters :format => [:json] + RUBY + require "#{app_path}/config/environment" + require 'action_controller/base' + + assert_equal [:json], ActionController::Base._wrapper_options[:format] + end end end -- cgit v1.2.3