module ActionView::TestCase::Behavior

def document_root_element

Need to experiment if this priority is the best one: rendered => output_buffer
def document_root_element
  Rails::Dom::Testing.html_document.parse(@rendered.blank? ? @output_buffer.to_str : @rendered).root
end