I’m new to testing, so bear with me 🙂
I would like to test for random content on a page. For example, let’s test the page for displaying the content either ‘foo’ or ‘bar’.
Something like the below is what I’m trying to achieve
page.should (have_content('foo') || have_content('bar'))
Any ideas?
I don’t know any ready to use Mather for you. But you can bake your own.
using satisfy:
page.should satisfy {|page| page.has_content?('foo') or page.has_content?('bar')}or simple_matcher
Edit:
has_contentaccepts regex, so you can check forpage.should have_content(/foo|bar/)