    # File lib/action_controller/assertions/selector_assertions.rb, line 552
          def assert_select_email(&block)
            deliveries = ActionMailer::Base.deliveries
            assert !deliveries.empty?, "No e-mail in delivery list"

            for delivery in deliveries
              for part in delivery.parts
                if part["Content-Type"].to_s =~ /^text\/html\W/
                  root = HTML::Document.new(part.body).root
                  assert_select root, ":root", &block
                end
              end
            end
          end