aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/query_cache_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-01-16 11:19:08 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-01-16 11:19:08 -0800
commitf19ba681a80c0b0be604c58389ce2892c623d027 (patch)
treeb8020f0e30d6dc93823e5fe9c6fe16a9ada67b74 /activerecord/test/cases/query_cache_test.rb
parentf3e379f0c97149bb29a63dc9db8a2836addcd957 (diff)
parent73ba2c14cd7d7dfb2d132b18c47ade995401736f (diff)
downloadrails-f19ba681a80c0b0be604c58389ce2892c623d027.tar.gz
rails-f19ba681a80c0b0be604c58389ce2892c623d027.tar.bz2
rails-f19ba681a80c0b0be604c58389ce2892c623d027.zip
Merge branch 'master' into adequaterecord
* master: Make AR::Base#touch fire the after_commit and after_rollback callbacks Fix test for cache_key + touched Revert "methods are defined right after the module_eval, so we don't need to do" Revert "Don't remove trailing slash from PATH_INFO for mounted apps" Add failing test for #13369 reset column information after fiddling with `Encoding.default_internal` we have `with_env_tz` as global test helper. Remove duplicate. isolate class attribute assignment in `migration_test.rb` use `teardown` for cleanup, not `setup`. tests without transactional fixtures need to cleanup afterwards. no need to `return skip` in tests. `skip` is enough. methods are defined right after the module_eval, so we don't need to do any line number maths Get rid of unused TransactionError constant Avoid converting :on option to array twice when defining commit/rollback callbacks Unify changelog entries about single quotes [ci skip] Use single quotes in generated files
Diffstat (limited to 'activerecord/test/cases/query_cache_test.rb')
-rw-r--r--activerecord/test/cases/query_cache_test.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/test/cases/query_cache_test.rb b/activerecord/test/cases/query_cache_test.rb
index 5566563116..da8ae672fe 100644
--- a/activerecord/test/cases/query_cache_test.rb
+++ b/activerecord/test/cases/query_cache_test.rb
@@ -8,7 +8,7 @@ require 'rack'
class QueryCacheTest < ActiveRecord::TestCase
fixtures :tasks, :topics, :categories, :posts, :categories_posts
- def setup
+ teardown do
Task.connection.clear_query_cache
ActiveRecord::Base.connection.disable_query_cache!
end
@@ -214,7 +214,7 @@ class QueryCacheExpiryTest < ActiveRecord::TestCase
Post.find(1)
# change the column definition
- Post.connection.change_column :posts, :title, :string, :limit => 80
+ Post.connection.change_column :posts, :title, :string, limit: 80
assert_nothing_raised { Post.find(1) }
# restore the old definition
@@ -241,7 +241,6 @@ class QueryCacheExpiryTest < ActiveRecord::TestCase
def test_update
Task.connection.expects(:clear_query_cache).times(2)
-
Task.cache do
task = Task.find(1)
task.starting = Time.now.utc
@@ -251,7 +250,6 @@ class QueryCacheExpiryTest < ActiveRecord::TestCase
def test_destroy
Task.connection.expects(:clear_query_cache).times(2)
-
Task.cache do
Task.find(1).destroy
end
@@ -259,7 +257,6 @@ class QueryCacheExpiryTest < ActiveRecord::TestCase
def test_insert
ActiveRecord::Base.connection.expects(:clear_query_cache).times(2)
-
Task.cache do
Task.create!
end