diff options
author | Joe Van Dyk <joe@fixieconsulting.com> | 2011-10-27 08:25:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-27 10:50:38 -0700 |
commit | 420f7fd507fd5868adc1e0398c2422aac16d2013 (patch) | |
tree | cc22919afca572c5ea021ac81dc2271d2d5ea883 /activerecord | |
parent | 1ad9138c009c941f453dcc6a14f308e6da9fb84a (diff) | |
download | rails-420f7fd507fd5868adc1e0398c2422aac16d2013.tar.gz rails-420f7fd507fd5868adc1e0398c2422aac16d2013.tar.bz2 rails-420f7fd507fd5868adc1e0398c2422aac16d2013.zip |
Added failing test case for changing schema in migration not clearing the prepared statement cache
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/query_cache_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb index b2429d631f..9554386dcf 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -170,6 +170,18 @@ end class QueryCacheExpiryTest < ActiveRecord::TestCase fixtures :tasks, :posts, :categories, :categories_posts + def test_cache_gets_cleared_after_migration + # warm the cache + Post.find(1) + + # change the column definition + Post.connection.change_column :posts, :title, :string, :limit => 80 + assert_nothing_raised { Post.find(1) } + + # restore the old definition + Post.connection.change_column :posts, :title, :string + end + def test_find Task.connection.expects(:clear_query_cache).times(1) |