Default to match once with have_content

9 views
Skip to first unread message

Erick Sasse

unread,
Jun 1, 2023, 1:17:59 PMJun 1
to Capybara
Hi all,

Is it possible to configure the have_content matcher to match "once" and raise error if more than one match is found?

What I want is the same behavior that I get when I use "once" but whitout using it explicitily.

I tried different options for Capybara.match, but no effect.

Thanks!
Erick


Thomas Walpole

unread,
Jun 2, 2023, 7:28:57 PMJun 2
to Capybara
No there isn't. Easiest solution would be to add your own helper method which defaults to passing the `count: 1` option to have_content when called .
Reply all
Reply to author
Forward
0 new messages