method

assert_queries

Importance_0
v3.2.1 - Show latest stable - 0 notes - Class: ActiveRecord::TestCase
assert_queries(num = 1) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/test_case.rb, line 45
    def assert_queries(num = 1)
      ActiveRecord::SQLCounter.log = []
      yield
    ensure
      assert_equal num, ActiveRecord::SQLCounter.log.size, "#{ActiveRecord::SQLCounter.log.size} instead of #{num} queries were executed.#{ActiveRecord::SQLCounter.log.size == 0 ? '' : "\nQueries:\n#{ActiveRecord::SQLCounter.log.join("\n")}"}"
    end
Register or log in to add new notes.