diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 22:42:12 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 22:45:46 -0700 |
commit | 8d3e5c8c5200880a66abef3fd2f45104e65732e9 (patch) | |
tree | 574e92afc21fd5a7d98d88a02f328083c52ec6b8 /activerecord/test | |
parent | a0dfd84440f28d2862b7eb7ea340ca28d98fb23f (diff) | |
download | rails-8d3e5c8c5200880a66abef3fd2f45104e65732e9.tar.gz rails-8d3e5c8c5200880a66abef3fd2f45104e65732e9.tar.bz2 rails-8d3e5c8c5200880a66abef3fd2f45104e65732e9.zip |
hide more data in the schema cache
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/connection_adapters/schema_cache_test.rb | 23 |
2 files changed, 12 insertions, 15 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index aa09df5743..9c73e4ca00 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1358,9 +1358,9 @@ class BasicsTest < ActiveRecord::TestCase def test_clear_cache! # preheat cache - c1 = Post.connection.schema_cache.columns['posts'] + c1 = Post.connection.schema_cache.columns('posts') ActiveRecord::Base.clear_cache! - c2 = Post.connection.schema_cache.columns['posts'] + c2 = Post.connection.schema_cache.columns('posts') assert_not_equal c1, c2 end diff --git a/activerecord/test/cases/connection_adapters/schema_cache_test.rb b/activerecord/test/cases/connection_adapters/schema_cache_test.rb index c202659480..ecad7c942f 100644 --- a/activerecord/test/cases/connection_adapters/schema_cache_test.rb +++ b/activerecord/test/cases/connection_adapters/schema_cache_test.rb @@ -27,30 +27,27 @@ module ActiveRecord end def test_clearing - @cache.columns['posts'] - @cache.columns_hash['posts'] - @cache.tables['posts'] + @cache.columns('posts') + @cache.columns_hash('posts') + @cache.tables('posts') @cache.primary_keys('posts') @cache.clear! - assert_equal 0, @cache.columns.size - assert_equal 0, @cache.columns_hash.size - assert_equal 0, @cache.tables.size - assert_equal 0, @cache.primary_keys.size + assert_equal 0, @cache.size end def test_dump_and_load - @cache.columns['posts'] - @cache.columns_hash['posts'] - @cache.tables['posts'] + @cache.columns('posts') + @cache.columns_hash('posts') + @cache.tables('posts') @cache.primary_keys('posts') @cache = Marshal.load(Marshal.dump(@cache)) - assert_equal 12, @cache.columns['posts'].size - assert_equal 12, @cache.columns_hash['posts'].size - assert @cache.tables['posts'] + assert_equal 12, @cache.columns('posts').size + assert_equal 12, @cache.columns_hash('posts').size + assert @cache.tables('posts') assert_equal 'id', @cache.primary_keys('posts') end |