diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-03 15:35:34 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-03 15:35:44 -0800 |
commit | 7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd (patch) | |
tree | c0febaa28f316ba99e57a0899d316dc5e57f85d5 /activerecord/test/cases | |
parent | 082326deb5ba7e78d4a51ef6b8783d668066ed23 (diff) | |
download | rails-7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd.tar.gz rails-7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd.tar.bz2 rails-7423a71fc02c0ca3bf37b94e16a1322c0caaa6fd.zip |
allow AR caches to be cleared, clear them on class reloading
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index a255c07957..68adeff882 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1553,6 +1553,14 @@ class BasicsTest < ActiveRecord::TestCase end end + def test_clear_cache! + # preheat cache + c1 = Post.columns + ActiveRecord::Base.clear_cache! + c2 = Post.columns + assert_not_equal c1, c2 + end + def test_default_scope_is_reset Object.const_set :UnloadablePost, Class.new(ActiveRecord::Base) UnloadablePost.table_name = 'posts' |