diff options
author | kenta-s <knt01222@gmail.com> | 2017-02-13 19:27:30 +0900 |
---|---|---|
committer | kenta-s <knt01222@gmail.com> | 2017-02-13 19:28:37 +0900 |
commit | 8646911292d082e4c04e987f208378a587ab515d (patch) | |
tree | 4473012973a67252b670167fb84878d038ea76eb | |
parent | efe121eab01d70c9da5747597d8ac6f526f2da4e (diff) | |
download | rails-8646911292d082e4c04e987f208378a587ab515d.tar.gz rails-8646911292d082e4c04e987f208378a587ab515d.tar.bz2 rails-8646911292d082e4c04e987f208378a587ab515d.zip |
Refactor `test_find_by_does_not_use_statement_cache_if_table_name_is_changed`
-rw-r--r-- | activerecord/test/cases/statement_cache_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/statement_cache_test.rb b/activerecord/test/cases/statement_cache_test.rb index ab81ee1ad6..fab3648564 100644 --- a/activerecord/test/cases/statement_cache_test.rb +++ b/activerecord/test/cases/statement_cache_test.rb @@ -109,11 +109,11 @@ module ActiveRecord def test_find_by_does_not_use_statement_cache_if_table_name_is_changed book = Book.create(name: "my book") - Book.find_by(name: "my book") # warming the statement cache. + Book.find_by(name: book.name) # warming the statement cache. # changing the table name should change the query that is not cached. Book.table_name = :birds - assert_nil Book.find_by(name: "my book") + assert_nil Book.find_by(name: book.name) ensure Book.table_name = :books end |