method

assert_no_notifications

assert_no_notifications(pattern = nil, &block)
public

Assert no notifications were emitted for a given pattern.

You can assert no notifications were emitted by passing a pattern, which accepts either a string or regexp, and a block. While the block is executed, if no matching notifications are emitted, the assertion will pass.

assert_no_notifications("post.submitted") do
  post.destroy # => emits non-matching notification
end