1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Show the failed queries in test_has_one_does_not_use_order_by

For investigating the cause of failure.

https://travis-ci.org/rails/rails/jobs/287474883#L797-L799
This commit is contained in:
Ryuta Kamizono 2017-10-14 12:28:08 +09:00
parent d1695b4fe4
commit 3d1ff79742

View file

@ -30,7 +30,8 @@ class HasOneAssociationsTest < ActiveRecord::TestCase
ActiveRecord::SQLCounter.clear_log
companies(:first_firm).account
ensure
assert ActiveRecord::SQLCounter.log_all.all? { |sql| /order by/i !~ sql }, "ORDER BY was used in the query"
log_all = ActiveRecord::SQLCounter.log_all
assert log_all.all? { |sql| /order by/i !~ sql }, "ORDER BY was used in the query: #{log_all}"
end
def test_has_one_cache_nils