diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-13 08:20:38 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-11-13 08:20:38 -0800 |
commit | 5ed0381db5e6dff1269f3f22ec4fa69c203c37d9 (patch) | |
tree | e6f454a3553e05b5a01c199b0b0bafe7f5eb06cf /activerecord/test | |
parent | 267fb61277ac960ad443d239febcb3136a007d24 (diff) | |
parent | fda90755301553e184f625f3ba27d34888dbfad4 (diff) | |
download | rails-5ed0381db5e6dff1269f3f22ec4fa69c203c37d9.tar.gz rails-5ed0381db5e6dff1269f3f22ec4fa69c203c37d9.tar.bz2 rails-5ed0381db5e6dff1269f3f22ec4fa69c203c37d9.zip |
Merge pull request #8205 from kennyj/fix_6951-32
Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
Diffstat (limited to 'activerecord/test')
-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 dd881f8230..dfc6ea2457 100644 --- a/activerecord/test/cases/query_cache_test.rb +++ b/activerecord/test/cases/query_cache_test.rb @@ -173,6 +173,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 |