From 393167f57f7a167d3ad6f5bb16d351dfad2f3568 Mon Sep 17 00:00:00 2001 From: SachinGokal Date: Tue, 3 Apr 2018 16:07:36 -0400 Subject: [PATCH] remove params field --- app/controllers/impressionist_controller.rb | 4 +-- .../controllers/articles_controller_spec.rb | 30 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/app/controllers/impressionist_controller.rb b/app/controllers/impressionist_controller.rb index 9bfcb223..91277978 100644 --- a/app/controllers/impressionist_controller.rb +++ b/app/controllers/impressionist_controller.rb @@ -51,7 +51,6 @@ def impressionist_subapp_filter(opts = {}) # creates a statment hash that contains default values for creating an impression via an AR relation. def associative_create_statement(query_params={}) - filter = ActionDispatch::Http::ParameterFilter.new(Rails.application.config.filter_parameters) query_params.reverse_merge!( :controller_name => controller_name, :action_name => action_name, @@ -59,8 +58,7 @@ def associative_create_statement(query_params={}) :request_hash => @impressionist_hash, :session_hash => session_hash, :ip_address => request.remote_ip, - :referrer => request.referer, - :params => filter.filter(params_hash) + :referrer => request.referer ) end diff --git a/tests/test_app/spec/controllers/articles_controller_spec.rb b/tests/test_app/spec/controllers/articles_controller_spec.rb index c41eda2d..b1e236c6 100644 --- a/tests/test_app/spec/controllers/articles_controller_spec.rb +++ b/tests/test_app/spec/controllers/articles_controller_spec.rb @@ -72,19 +72,19 @@ Impression.last.referrer.should eq nil end - describe "when filtering params" do - before do - @_filtered_params = Rails.application.config.filter_parameters - Rails.application.config.filter_parameters = [:password] - end - - it "values should not be recorded" do - get "index", password: "best-password-ever" - Impression.last.params.should eq("password" => "[FILTERED]") - end - - after do - Rails.application.config.filter_parameters = @_filtered_params - end - end + # describe "when filtering params" do + # before do + # @_filtered_params = Rails.application.config.filter_parameters + # Rails.application.config.filter_parameters = [:password] + # end + # + # it "values should not be recorded" do + # get "index", password: "best-password-ever" + # Impression.last.params.should eq("password" => "[FILTERED]") + # end + # + # after do + # Rails.application.config.filter_parameters = @_filtered_params + # end + # end end