diff options
author | Xavier Noria <fxn@hashref.com> | 2012-11-26 07:43:43 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-01-22 19:54:01 -0200 |
commit | 29d564add926307fea8cd3f77caf88d735e252a1 (patch) | |
tree | 44e0642936dbab6d9d3f261e727bc924c6a8999a /activerecord/test/cases | |
parent | 97a4db91d69d1795fe9079027968f0c0453bd0a1 (diff) | |
download | rails-29d564add926307fea8cd3f77caf88d735e252a1.tar.gz rails-29d564add926307fea8cd3f77caf88d735e252a1.tar.bz2 rails-29d564add926307fea8cd3f77caf88d735e252a1.zip |
Merge pull request #6197 from blakesmith/connection_adapters_without_explain_support
Don't run explain on slow queries for database adapters that don't support it
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/explain_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/explain_test.rb b/activerecord/test/cases/explain_test.rb index cb7781f8e7..bdeb0a033c 100644 --- a/activerecord/test/cases/explain_test.rb +++ b/activerecord/test/cases/explain_test.rb @@ -98,6 +98,16 @@ if ActiveRecord::Base.connection.supports_explain? assert_equal expected, base.exec_explain(queries) end + def test_unsupported_connection_adapter + connection.stubs(:supports_explain?).returns(false) + + base.logger.expects(:warn).never + + with_threshold(0) do + Car.where(:name => 'honda').to_a + end + end + def test_silence_auto_explain base.expects(:collecting_sqls_for_explain).never base.logger.expects(:warn).never |