instance method
assert_no_queries_match
Ruby on Rails 8.1.2
Since v7.2.3Signature
assert_no_queries_match(match, include_schema: false, &block)
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 }
Parameters
-
matchreq -
include_schemakey = false -
blockblock
Source
# File activerecord/lib/active_record/testing/query_assertions.rb, line 93
def assert_no_queries_match(match, include_schema: false, &block)
assert_queries_match(match, count: 0, include_schema: include_schema, &block)
end
Defined in activerecord/lib/active_record/testing/query_assertions.rb line 93
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Assertions::QueryAssertions