This project is archived and is in readonly mode.

#60 ✓invalid
T.J. VanSlyke

have_tag/assert_select does not validate XML with periods in attribute names

Reported by T.J. VanSlyke | April 28th, 2008 @ 05:25 PM

While creating specs for a method to generate valid GraphML, I needed to use attributes with periods ('.') in their names (i.e. ''). However, as it stands, assert_select uses the HTML::Node.parse method to parse its input. This method does not allow periods in attribute names (the valid characters are represented by the regex /[-\w:\]+/). My temporary solution was to monkeypatch the HTML::Node.parse method in my spec_helpers.rb to accept periods by changing the regex to read /[-\w:\.]+/. However, that is obviously not a reasonable solution.

Is anyone aware of this issue? If so, is it a problem inherent in Rails or am I missing some kind of alternative XML parser which allows for this syntax?

Thanks all!

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages