How to show SQL query log generated by a RSpec test?
Put the following code in your specs:
Rails 7.0+
ActiveRecord.verbose_query_logs = true
Rails 5.2
ActiveRecord::Base.verbose_query_logs = true
Rails 3.0
ActiveRecord::Base.logger = Logger.new(STDOUT) if defined?(ActiveRecord::Base)
Thanks to everyone who commented for the Rails updates.