Flowdock
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 26
    def assert_queries(num = 1)
      $queries_executed = []
      yield
    ensure
      %w{ BEGIN COMMIT }.each { |x| $queries_executed.delete(x) }
      assert_equal num, $queries_executed.size, "#{$queries_executed.size} instead of #{num} queries were executed.#{$queries_executed.size == 0 ? '' : "\nQueries:\n#{$queries_executed.join("\n")}"}"
    end
Register or log in to add new notes.