diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-30 18:27:40 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-30 18:27:40 -0700 |
commit | 85039d4b75ceb41a020e2cc8e3a0f39709b1fbc4 (patch) | |
tree | 2d3cb829b8fcbcf4cc9aba6eedb6d2757e527a66 /activerecord/test/cases/query_cache_test.rb | |
parent | 7e17b0baec4ea811c1a7e3bd491eaedf95b1feb4 (diff) | |
parent | a7c3c9025009cef98cd91ff27707f678cb8fb3c3 (diff) | |
download | rails-85039d4b75ceb41a020e2cc8e3a0f39709b1fbc4.tar.gz rails-85039d4b75ceb41a020e2cc8e3a0f39709b1fbc4.tar.bz2 rails-85039d4b75ceb41a020e2cc8e3a0f39709b1fbc4.zip |
Merge pull request #8074 from kennyj/fix_6951
Fix #6951. Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
Diffstat (limited to 'activerecord/test/cases/query_cache_test.rb')
-rw-r--r-- | activerecord/test/cases/query_cache_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb index 51a285a2b4..4ff481e6a5 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -184,6 +184,17 @@ class QueryCacheTest < ActiveRecord::TestCase assert_queries(2) { task.lock!; task.lock! } end end + + def test_cache_is_available_when_connection_is_connected + conf = ActiveRecord::Base.configurations + + ActiveRecord::Base.configurations = {} + Task.cache do + assert_queries(1) { Task.find(1); Task.find(1) } + end + ensure + ActiveRecord::Base.configurations = conf + end end class QueryCacheExpiryTest < ActiveRecord::TestCase |