String escape sequences in Test environment

I’m attempting to use the assert valid markup plugin (http:// but I’m having a
really strange issue with the way my strings are handled in the test

I’ve got some html fragments stored in the database that get retrieved
and shown on certain pages (as just about every rails app does, I
expect). These html fragments are indexed by a unique name in a table
named page_html_parts. My code to retrieve them is like this:

part = PageHtmlPart.find(:first, :conditions => [“name = ?”, name])

When validating my xhtml using the plugin in test mode, I get extra
escape sequences in the html returned by my PageHtmlPart object. For
example, the quotes around the URLs in my anchor tags get changed to
" (i.e. the ruby escape sequence for a double quote within a double-
quoted string). In turn, the extra slash gets inserted into my xhtml
that gets passed on the W3C validator, and consequently my validation

In development and production mode, this works fine. I’ve set a
breakpoint and inspected the results I’m getting here, and in these
modes there are no escape sequences. My XHTML is valid.

Does the Rails test environment treat strings differently form the
production and development environments? Does anyone know how to fix


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs