method
assert_select_email
v3.0.0 -
Show latest stable
- Class:
ActionDispatch::Assertions::SelectorAssertions
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
Examples
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