aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/log_subscriber_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-03 01:03:21 +0200
committerJosé Valim <jose.valim@gmail.com>2011-05-03 01:04:57 +0200
commita55f2de0c5baae589b1730df1e4068f0cd1474ce (patch)
tree34ea073190afa3287f00cf82408c9766497e5682 /actionpack/test/controller/log_subscriber_test.rb
parent1afb56f4818381098c6ed0babc4a5899e324e2e5 (diff)
downloadrails-a55f2de0c5baae589b1730df1e4068f0cd1474ce.tar.gz
rails-a55f2de0c5baae589b1730df1e4068f0cd1474ce.tar.bz2
rails-a55f2de0c5baae589b1730df1e4068f0cd1474ce.zip
Improve performance for filtered parameters and add tests.
Diffstat (limited to 'actionpack/test/controller/log_subscriber_test.rb')
-rw-r--r--actionpack/test/controller/log_subscriber_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb
index ddfa3df552..5d7a51e902 100644
--- a/actionpack/test/controller/log_subscriber_test.rb
+++ b/actionpack/test/controller/log_subscriber_test.rb
@@ -4,6 +4,8 @@ require "action_controller/log_subscriber"
module Another
class LogSubscribersController < ActionController::Base
+ wrap_parameters :person, :only => :name, :format => :json
+
def show
render :nothing => true
end
@@ -95,6 +97,15 @@ class ACLogSubscriberTest < ActionController::TestCase
assert_equal 'Parameters: {"id"=>"10"}', logs[1]
end
+ def test_process_action_with_wrapped_parameters
+ @request.env['CONTENT_TYPE'] = 'application/json'
+ post :show, :id => '10', :name => 'jose'
+ wait
+
+ assert_equal 3, logs.size
+ assert_match '"person"=>{"name"=>"jose"}', logs[1]
+ end
+
def test_process_action_with_view_runtime
get :show
wait