Added CDATA tags around form helper Javascript #295

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
3 participants
@stuartc
Contributor

stuartc commented Mar 15, 2012

When running view tests, I was getting piles of warnings like this from assert_select:

ignoring attempt to close div with script
 opened at byte 15673, line 411
 closed at byte 18702, line 411
 attributes at open: {"class"=>"\\\"field_with_errors\\\""}
 text around open: "ilder\",\"input_tag\":\"<div class=\\\"field_w"
 text around close: "act.processing\"}}}};</script>\n</fieldset"

It seems that most parsers/assert_select can't discern embedded HTML inside a script tag.
After some fiddling I added some CDATA tags on the inside of the script tag the form_helper adds to
the bottom of the form. All my JS still worked, and all my capybara tests still passed.

It's a pretty minor change.

@garyharan

This comment has been minimized.

Show comment Hide comment
@garyharan

garyharan Mar 30, 2012

+1

+1

@stuartc

This comment has been minimized.

Show comment Hide comment
@stuartc

stuartc Apr 20, 2012

Contributor

Apologies, going to resubmit this, asked for a pull off master.

Contributor

stuartc commented Apr 20, 2012

Apologies, going to resubmit this, asked for a pull off master.

@stuartc stuartc closed this Apr 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment