【发布时间】:2010-12-12 21:00:35
【问题描述】:
有谁知道如何使 assert_select 在 rake 测试期间不输出所有那些讨厌的 html 警告?你知道的,像这样的东西:
.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"
谢谢
【问题讨论】:
-
我遇到了同样的问题,W3C 验证器告诉我我的代码是有效的。我的问题是关于
<=和=>我在视图中的一些 javascript (<script> if (something >= 1) {return 1;} </script>) 中使用。解决方案是用 CDATA 标记 (<script>//<![CDATA[ if (something >= 1) {return 1;} //]]></script>) 围绕脚本。有关详细信息,请参阅此 SO 答案:stackoverflow.com/questions/66837/… -
关闭你的标签:)
标签: ruby-on-rails functional-testing