diff options
author | Xavier Noria <fxn@hashref.com> | 2010-07-22 01:29:18 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-07-22 01:29:18 +0200 |
commit | 919eb200a9a0969c444b938d08eb4661d41ba986 (patch) | |
tree | 329cbe815d549275cc0dc6aa0f75c18d8954f105 /activerecord/test/cases/log_subscriber_test.rb | |
parent | 56669ec3048de316918ec5ad554fff83d757911b (diff) | |
parent | b456877cfb7e0cb0bab9ffd5674abd23caba0ab4 (diff) | |
download | rails-919eb200a9a0969c444b938d08eb4661d41ba986.tar.gz rails-919eb200a9a0969c444b938d08eb4661d41ba986.tar.bz2 rails-919eb200a9a0969c444b938d08eb4661d41ba986.zip |
Merge remote branch 'rails/master'
Diffstat (limited to 'activerecord/test/cases/log_subscriber_test.rb')
-rw-r--r-- | activerecord/test/cases/log_subscriber_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/activerecord/test/cases/log_subscriber_test.rb b/activerecord/test/cases/log_subscriber_test.rb index cde383783b..342daa19df 100644 --- a/activerecord/test/cases/log_subscriber_test.rb +++ b/activerecord/test/cases/log_subscriber_test.rb @@ -4,6 +4,7 @@ require "active_support/log_subscriber/test_helper" class LogSubscriberTest < ActiveRecord::TestCase include ActiveSupport::LogSubscriber::TestHelper + include ActiveSupport::BufferedLogger::Severity def setup @old_logger = ActiveRecord::Base.logger @@ -39,4 +40,21 @@ class LogSubscriberTest < ActiveRecord::TestCase assert_match(/CACHE/, @logger.logged(:debug).last) assert_match(/SELECT .*?FROM .?developers.?/i, @logger.logged(:debug).last) end + + def test_basic_query_doesnt_log_when_level_is_not_debug + @logger.level = INFO + Developer.all + wait + assert_equal 0, @logger.logged(:debug).size + end + + def test_cached_queries_doesnt_log_when_level_is_not_debug + @logger.level = INFO + ActiveRecord::Base.cache do + Developer.all + Developer.all + end + wait + assert_equal 0, @logger.logged(:debug).size + end end |