assert_select is what you want. It allows you to use the CSS selector to parse HTML and validate values.
See this assert_select
EDIT: I missed this, not necessarily the rails. You can either import the appropriate rail into your test environment, or use something like HPricot to allow you to evaluate the result as HTML and check the correct values.
source share