diff options
Diffstat (limited to 'actionpack/test/controller/log_subscriber_test.rb')
-rw-r--r-- | actionpack/test/controller/log_subscriber_test.rb | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 929545fc10..49be7caf38 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -46,20 +46,20 @@ module Another render :inline => "<%= cache('foo%bar'){ 'Contains % sign in key' } %>" end - def with_fragment_cache_and_if_true_condition - render :inline => "<%= cache('foo', :if => true) { 'bar' } %>" + def with_fragment_cache_if_with_true_condition + render :inline => "<%= cache_if(true, 'foo') { 'bar' } %>" end - def with_fragment_cache_and_if_false_condition - render :inline => "<%= cache('foo', :if => false) { 'bar' } %>" + def with_fragment_cache_if_with_false_condition + render :inline => "<%= cache_if(false, 'foo') { 'bar' } %>" end - def with_fragment_cache_and_unless_false_condition - render :inline => "<%= cache('foo', :unless => false) { 'bar' } %>" + def with_fragment_cache_unless_with_false_condition + render :inline => "<%= cache_unless(false, 'foo') { 'bar' } %>" end - def with_fragment_cache_and_unless_true_condition - render :inline => "<%= cache('foo', :unless => true) { 'bar' } %>" + def with_fragment_cache_unless_with_true_condition + render :inline => "<%= cache_unless(true, 'foo') { 'bar' } %>" end def with_exception @@ -85,7 +85,7 @@ class ACLogSubscriberTest < ActionController::TestCase @old_logger = ActionController::Base.logger - @cache_path = File.expand_path('../temp/test_cache', File.dirname(__FILE__)) + @cache_path = File.join Dir.tmpdir, Dir::Tmpname.make_tmpname('tmp', 'cache') @controller.cache_store = :file_store, @cache_path ActionController::LogSubscriber.attach_to :action_controller end @@ -137,6 +137,17 @@ class ACLogSubscriberTest < ActionController::TestCase assert_equal 'Parameters: {"id"=>"10"}', logs[1] end + def test_multiple_process_with_parameters + get :show, :id => '10' + get :show, :id => '20' + + wait + + assert_equal 6, logs.size + assert_equal 'Parameters: {"id"=>"10"}', logs[1] + assert_equal 'Parameters: {"id"=>"20"}', logs[4] + end + def test_process_action_with_wrapped_parameters @request.env['CONTENT_TYPE'] = 'application/json' post :show, :id => '10', :name => 'jose' @@ -219,9 +230,9 @@ class ACLogSubscriberTest < ActionController::TestCase @controller.config.perform_caching = true end - def test_with_fragment_cache_and_if_true + def test_with_fragment_cache_if_with_true @controller.config.perform_caching = true - get :with_fragment_cache_and_if_true_condition + get :with_fragment_cache_if_with_true_condition wait assert_equal 4, logs.size @@ -231,9 +242,9 @@ class ACLogSubscriberTest < ActionController::TestCase @controller.config.perform_caching = true end - def test_with_fragment_cache_and_if_false + def test_with_fragment_cache_if_with_false @controller.config.perform_caching = true - get :with_fragment_cache_and_if_false_condition + get :with_fragment_cache_if_with_false_condition wait assert_equal 2, logs.size @@ -243,9 +254,9 @@ class ACLogSubscriberTest < ActionController::TestCase @controller.config.perform_caching = true end - def test_with_fragment_cache_and_unless_true + def test_with_fragment_cache_unless_with_true @controller.config.perform_caching = true - get :with_fragment_cache_and_unless_true_condition + get :with_fragment_cache_unless_with_true_condition wait assert_equal 2, logs.size @@ -255,9 +266,9 @@ class ACLogSubscriberTest < ActionController::TestCase @controller.config.perform_caching = true end - def test_with_fragment_cache_and_unless_false + def test_with_fragment_cache_unless_with_false @controller.config.perform_caching = true - get :with_fragment_cache_and_unless_false_condition + get :with_fragment_cache_unless_with_false_condition wait assert_equal 4, logs.size |