rails/rails-dom-testing

`assert_dom_equal` should default `expected` to `document_root_element`

chancancode opened this issue ยท 5 comments

This seems consistent with the assert_select API... ๐Ÿ‘ / ๐Ÿ‘Ž ?

๐Ÿ‘

Sounds good to me, yeah ๐Ÿ‘

Hmm, on second thought. Why is it expected, we want to default document_root_element to and not actual?

Also unsure if having an *_equal assertion without 2 args would read. Consider:

assert_equal 'cheese'

How about this?

def assert_dom(expected, message = nil)
  assert_dom_equal expected, document_root_element, message
end

Ha, okay, then it makes more sense ๐Ÿ˜„