views:

195

answers:

3

Does anyone know how to make assert_select not output all those nasty html warnings during a rake test? You know, like this stuff:

.ignoring attempt to close body with div
opened at byte 1036, line 5
closed at byte 5342, line 42
attributes at open: {"class"=>"inner02"}
text around open: "</script>\r\t</head>\r\t<body class=\"inner02"
text around close: "\t</div>\r\t\t\t</div>\r\t\t</div>\r\t</body>\r</ht"

Thanks

+1  A: 

It's rather that your code is generating invalid HTML. I suggest running it through a validator and fixing all the validation errors.

Ryan Bigg
+1  A: 

Rails's HTML scanner expects XHTML, if you're using HTML4 where tags don't have explicit closing tags, you may get this warning... doesn't look like solved issue

ryw
A: 

What I'd want is to know where the warning is coming from. The fact it doesn't specify the test or the controller/action which generates the invalid HTML is the big problem for me.

ben
Yeah, that is very annoying! It took me a while to finally get rid of all the warning errors.
CalebHC