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
It's rather that your code is generating invalid HTML. I suggest running it through a validator and fixing all the validation errors.
You can find out which test ran into the problem by using the TESTOPTS v flag: (bundle exec) rake test TESTOPTS="-v"
This will give:
test: Request the homepage should have a node list. (PresentControllerTest): .
test: Request the homepage should have the correct title. (PresentControllerTest): ignoring attempt to close div with body
opened at byte 4378, line 89
closed at byte 17745, line 393
attributes at open: {"class"=>"colleft"}
text around open: "class=\"colmid\"> \n\t\t\t<div class=\"colleft\""
text around close: "x2.js\" ></script>\n </body>\n</html>\n\n"
ignoring attempt to close div with html
opened at byte 4378, line 89
closed at byte 17753, line 394
attributes at open: {"class"=>"colleft"}
text around open: "class=\"colmid\"> \n\t\t\t<div class=\"colleft\""
text around close: "</script>\n </body>\n</html>\n\n"
.
test: Request the homepage should not set the flash. (PresentControllerTest): .
test: Request the homepage should respond with 200. (PresentControllerTest): .
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With