method

assert_no_queries_match

rails latest stable - Class: ActiveRecord::Assertions::QueryAssertions

Method not available on this version

This method is only available on newer versions. The first available version (v7.2.3) is shown here.

assert_no_queries_match(match, include_schema: false, &block)
public

Asserts that no SQL queries matching the pattern are executed in the given block.

assert_no_queries_match(/SELECT/i) { post.comments }

If the :include_schema option is provided, any queries (including schema related) that match the matcher are counted.

assert_no_queries_match(/FROM pg_attribute/i, include_schema: true) { Post.columns }