diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2010-07-19 13:33:26 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-07-19 13:44:43 -0700 |
commit | e466354edb31f243899051e2119f4ce72bafd5f3 (patch) | |
tree | d1d72ea1b372e3fd6749fcd596b55c4efe1c31d2 /actionpack/test | |
parent | 202fb79e8686ee127fe49497c979cfc9c9d985d5 (diff) | |
download | rails-e466354edb31f243899051e2119f4ce72bafd5f3.tar.gz rails-e466354edb31f243899051e2119f4ce72bafd5f3.tar.bz2 rails-e466354edb31f243899051e2119f4ce72bafd5f3.zip |
Extract ParameterFilter class from FilterParameters mixin
Signed-off-by: wycats <wycats@gmail.com>
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/request_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb index e5ee412021..c8947aac80 100644 --- a/actionpack/test/dispatch/request_test.rb +++ b/actionpack/test/dispatch/request_test.rb @@ -392,19 +392,19 @@ class RequestTest < ActiveSupport::TestCase [{'baz'=>[{'foo'=>'baz'}, "1"]}, {'baz'=>[{'foo'=>'[FILTERED]'}, "1"]}, [/foo/]]] test_hashes.each do |before_filter, after_filter, filter_words| - request = stub_request('action_dispatch.parameter_filter' => filter_words) - assert_equal after_filter, request.send(:process_parameter_filter, before_filter) + parameter_filter = ActionDispatch::Http::ParameterFilter.new(filter_words) + assert_equal after_filter, parameter_filter.filter(before_filter) filter_words << 'blah' filter_words << lambda { |key, value| value.reverse! if key =~ /bargain/ } - request = stub_request('action_dispatch.parameter_filter' => filter_words) + parameter_filter = ActionDispatch::Http::ParameterFilter.new(filter_words) before_filter['barg'] = {'bargain'=>'gain', 'blah'=>'bar', 'bar'=>{'bargain'=>{'blah'=>'foo'}}} after_filter['barg'] = {'bargain'=>'niag', 'blah'=>'[FILTERED]', 'bar'=>{'bargain'=>{'blah'=>'[FILTERED]'}}} - assert_equal after_filter, request.send(:process_parameter_filter, before_filter) + assert_equal after_filter, parameter_filter.filter(before_filter) end end |