Flowdock
method

assert_select_email

Importance_1
Ruby on Rails latest stable (v6.1.7.7) - 0 notes - Class: ActionDispatch::Assertions::SelectorAssertions

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.1.8) is shown here.

assert_select_email(&block) public

Extracts the body of an email and runs nested assertions on it.

You must enable deliveries for this assertion to work, use:

 ActionMailer::Base.perform_deliveries = true

assert_select_email do
  assert_select "h1", "Email alert"
end

assert_select_email do
  items = assert_select "ol>li"
  items.each do
     # Work with items here...
  end
end
Show source
Register or log in to add new notes.