[rspec-users] rspec_on_rails: assert_select wrapper doesn't play nice with XML

Ian Leitch port001 at gmail.com
Wed Jun 27 04:48:13 EDT 2007


I'm using rspec and rspec_on_rails to test some RSS feed views, the problem
is that the specs spew out messy warnings when they run:

ignoring attempt to close channel with link
  opened at byte 61, line 3
  closed at byte 141, line 5
  attributes at open: {}
  text around open: "ss version=\"2.0\">\n  <channel>\n    <title"
  text around close: "brands/2154/feed.rss</link>\n    <descrip"

The XML in the view is actually well formed, the problem is that the
HTML::Document class used is not instantiated in XML mode when an XML
response body is present.
See http://weblog.jamisbuck.org/2007/1/4/assert_xml_select for more info.

I've had a go at patching this and 'it works for me', but I've not spent
much time getting to know the internals of either rspec or rspec_on_rails,
so it may well be the wrong solution.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070627/845633e7/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rspec_on_rails_assert_select_xml_play_nice.patch
Type: application/octet-stream
Size: 1068 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rspec-users/attachments/20070627/845633e7/attachment.obj 

More information about the rspec-users mailing list