Ian Leitch
2007-Jun-27 08:48 UTC
[rspec-users] rspec_on_rails: assert_select wrapper doesn''t play nice with XML
Hey, 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. Cheers Ian -------------- 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
David Chelimsky
2007-Jun-27 11:23 UTC
[rspec-users] rspec_on_rails: assert_select wrapper doesn''t play nice with XML
On 6/27/07, Ian Leitch <port001 at gmail.com> wrote:> Hey, > > 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.Please post patches to the tracker, not the mailing lists. http://rubyforge.org/tracker/?group_id=797 Thanks, David> > Cheers > Ian > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > >