Handy assertion for your functional tests that checks your HTML/XHTML with the W3C Validator web service. If anything changes to invalidate your markup, you’ll know pronto. Responses from the web service are cached, so your tests aren’t slowed down unless something has changed. Provides both an instance method and a class method. Examples:
class FooControllerTest < Test::Unit::TestCase
def test_foo_markup
get :foo
assert_valid_markup
end
end
class FooControllerTest < Test::Unit::TestCase
assert_valid_markup :bar, :baz, :qux
end
svn: http://redgreenblu.com/svn/projects/assert_valid_markup/
Install with:
svn export http://redgreenblu.com/svn/projects/assert_valid_markup
And here’s a patch to make it work if you’re stuck behind an HTTP proxy:
http://www.dontblink.com/norm/assert_valid_markup_with_proxy.diff
See also Plugins