Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
html does not validate for some views #662
This is a general bug created to remind us that we have to validate our html.
There seem to be a number of badly formated html elements such as the
I think what we want is: https://github.com/realityforge/rails-assert-valid-asset
Had a bit of time to look at this.
I have started using "assert_valid_markup" just because it already has a gem for it, otherwise it might be better to use "assert_valid_asset", which is very similar.
Two problems that I've encountered:
Imo, the best course of action is to go through all the functional tests and add the assert_valid_markup ( or equivalent ) to all the tests where we want to check the html validation. Even this will result in a lot of tests failing, so I am not sure whether it is worth it to create a separate branch for this issue or not.
I think we should change the doctype to HTML5. Rails generates many data-* attributes which aren't valid in XHTML 4 strict. As for validation, this will get hairy since I don't think there are good tools available to validate HTML5. validator.w3.org has only experimental HTML5 validation support. It's not (yet) an approved standard after all.
You should be able to use shoulda generated names to exclude tests, though. The test name is basically a long string. Put an assert false in any of the shoulda tests and it will tell you the test "name". It'll be something like " should ". Remember, shoulda is compatible with plain Test::Unit
It might be worth creating a branch for this, yes.