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

refactor assert_sql query to reuse capture_sql

set assert_sql to reuse the capture_sql method from above
instead of repeating the code

in response to comments on issue #14546
This commit is contained in:
eileencodes 2014-03-31 22:53:45 -04:00
parent e9f53f7a7a
commit 49e17431ca

View file

@ -26,9 +26,7 @@ module ActiveRecord
end end
def assert_sql(*patterns_to_match) def assert_sql(*patterns_to_match)
SQLCounter.clear_log capture_sql { yield }
yield
SQLCounter.log_all
ensure ensure
failed_patterns = [] failed_patterns = []
patterns_to_match.each do |pattern| patterns_to_match.each do |pattern|