Fix warnings generated by assert_select

Some tags are not closed properly, so the HTML parser complains when
doing assert_select in functional tests.

Tested:
- rake test:functionals
Merge pull request #1483 from zhangsu/fix_assert_select_warnings

Fix warnings generated by assert_select.