method

assert_no_notifications

rails latest stable - Class: ActiveSupport::Testing::NotificationAssertions

Method not available on this version

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

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