Scott's Workblog

scott.bradley.wilson@gmail.com


attention!
This blog has moved! Go to my new blog!


April 19, 2007

Add W3C conformance to functional tests in Rails

I've just started using Asserts_valid_markup as part of test-driven development in Ruby On Rails. This very small helper allows you to add a test assertion for valid (X)HTML markup returned by any controller method.

This means that not only can you check that calls to controller methods return the right kind of response given the input, but that the response is properly formatted according to W3C.

This is potentially much more useful than 'static' validation as you can check whether a change to application logic has affected the validity of your views, or whether a change to one view helper method or partial has affected the validity of HTML in another view that includes it.

I wonder if someone will come up with a similar WCAG checker?

main archive