rails/rails-dom-testing

HTML entity matching has changed since Rails 4.1

dnrce opened this issue · 1 comments

dnrce commented

HTML entities are decoded prior to being matched by assert_select. This is a change from the version of assert_select that was built into Rails 4.1.

For example, given the following content,

<p>Lorem&nbsp;ipsum</p>

this worked in Rails 4.1:

assert_select 'p', 'Lorem&nbsp;ipsum'

but fails when using rails-dom-testing. This, on the other hand, now works:

assert_select 'p', "Lorem#{HTMLEntities.new.decode('&nbsp;')}ipsum"

Here's a gist that reproduces a comparison of these behaviors: https://gist.github.com/dnrce/7382ad582e1dc9953ca88741921dd64b

dnrce commented

I overlooked it, but this change is documented in the release notes: http://guides.rubyonrails.org/4_2_release_notes.html#assert-select