aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2011-04-03 20:19:52 -0300
committerJosé Valim <jose.valim@gmail.com>2011-04-04 10:48:17 +0200
commit454ec93ff79af4c0ddb31d01827021b549d12413 (patch)
tree871520b2628bc3e03a5092609524977537f8f4e2 /activerecord/test/cases
parentb35617235d43bdb32016a623044e7f4005879969 (diff)
downloadrails-454ec93ff79af4c0ddb31d01827021b549d12413.tar.gz
rails-454ec93ff79af4c0ddb31d01827021b549d12413.tar.bz2
rails-454ec93ff79af4c0ddb31d01827021b549d12413.zip
Add log message when loading records from Identity Map.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/identity_map_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb
index 9cf3db7f87..199e59657d 100644
--- a/activerecord/test/cases/identity_map_test.rb
+++ b/activerecord/test/cases/identity_map_test.rb
@@ -388,6 +388,15 @@ class IdentityMapTest < ActiveRecord::TestCase
assert_not_nil post.title
end
+ def test_log
+ log = StringIO.new
+ ActiveRecord::Base.logger = Logger.new(log)
+ ActiveRecord::Base.logger.level = Logger::DEBUG
+ Post.find 1
+ Post.find 1
+ assert_match(/Post with ID = 1 loaded from Identity Map/, log.string)
+ end
+
# Currently AR is not allowing changing primary key (see Persistence#update)
# So we ignore it. If this changes, this test needs to be uncommented.
# def test_updating_of_pkey