Method: ActiveRecord::Assertions::QueryAssertions#assert_no_queries_match
- Defined in:
- activerecord/lib/active_record/testing/query_assertions.rb
#assert_no_queries_match(match, include_schema: false, &block) ⇒ Object
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 }
87 88 89 |
# File 'activerecord/lib/active_record/testing/query_assertions.rb', line 87 def assert_no_queries_match(match, include_schema: false, &block) assert_queries_match(match, count: 0, include_schema: include_schema, &block) end |