rails / rails-dom-testing

Extracting DomAssertions and SelectorAssertions from ActionView.
MIT License
175 stars 57 forks source link

`assert_dom_equal` should default `expected` to `document_root_element` #60

Open chancancode opened 7 years ago

chancancode commented 7 years ago

This seems consistent with the assert_select API... 👍 / 👎 ?

rafaelfranca commented 7 years ago

👍

kaspth commented 7 years ago

Sounds good to me, yeah 👍

kaspth commented 7 years ago

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
chancancode commented 7 years ago

Eh I totally meant actual, not expected On Thu, Mar 9, 2017 at 11:39 AM Kasper Timm Hansen notifications@github.com wrote:

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, messageend

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rails/rails-dom-testing/issues/60#issuecomment-285458074, or mute the thread https://github.com/notifications/unsubscribe-auth/AADaFfWTXl58w8KTXnetQirHlWQNpxgSks5rkFVggaJpZM4MKr_E .

kaspth commented 7 years ago

Ha, okay, then it makes more sense 😄