[rspec-users] Matching Rails response to visible text

Sean DeNigris sean at clipperadams.com
Thu Feb 25 14:57:52 EST 2010


I did a bit of experimenting/Googling for what seems like a common
operation, but didn't like what I found (mostly hand-rolled

I want to verify response text, but don't care about the structure.
The text happens to be in a table, but appears to the user as pure

E.g. table with columns first_name = "Jim" and last_name = "Johnson"
looks to the reader like "Jim Johnson"
I want to say something like response.should include_text("Jim
Johnson"), but the html tags throw the match off.

Any suggestions?


More information about the rspec-users mailing list