diff options
author | Fabrizio Regini <freegenie@gmail.com> | 2012-10-01 00:00:44 +0200 |
---|---|---|
committer | Fabrizio Regini <freegenie@gmail.com> | 2012-12-05 11:07:14 +0100 |
commit | 86e3aaab939a67536f007d1633ec19521dba15e9 (patch) | |
tree | bae8f2b279a66616255fffc7709d2e9aad5998d1 /actionpack/test/controller | |
parent | 129eac024382c7fbdad2007e86cf25778d5f6787 (diff) | |
download | rails-86e3aaab939a67536f007d1633ec19521dba15e9.tar.gz rails-86e3aaab939a67536f007d1633ec19521dba15e9.tar.bz2 rails-86e3aaab939a67536f007d1633ec19521dba15e9.zip |
Adding filter capability to ActionController logs
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/log_subscriber_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 9efb6ab95f..7b4d49be20 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -26,6 +26,10 @@ module Another redirect_to "http://foo.bar/" end + def filterable_redirector + redirect_to "http://secret.foo.bar/" + end + def data_sender send_data "cool data", :filename => "file.txt" end @@ -152,6 +156,24 @@ class ACLogSubscriberTest < ActionController::TestCase assert_equal "Redirected to http://foo.bar/", logs[1] end + def test_filter_redirect_url_by_string + @request.env['action_dispatch.redirect_filter'] = ['secret'] + get :filterable_redirector + wait + + assert_equal 3, logs.size + assert_equal "Redirected to [FILTERED]", logs[1] + end + + def test_filter_redirect_url_by_regexp + @request.env['action_dispatch.redirect_filter'] = [/secret\.foo.+/] + get :filterable_redirector + wait + + assert_equal 3, logs.size + assert_equal "Redirected to [FILTERED]", logs[1] + end + def test_send_data get :data_sender wait |