Added failing test case for changing schema in migration not clearing the prepared statement cache
This commit is contained in:
parent
1ad9138c00
commit
420f7fd507
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue