diff options
Diffstat (limited to 'actionpack/test/controller/log_subscriber_test.rb')
-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 |