I am trying to use Capybara to verify that the list contains the correct items. For instance:
<table id="rodents">
<tr><td class="rodent_id">1</td><td class="rodent_name">Hamster</td></tr>
<tr><td class="rodent_id">2</td><td class="rodent_name">Gerbil</td></tr>
</table>
This list should contain identifiers 1 and 2, but should not include 3.
I would like something like:
ids = ?
ids.should include(1)
ids.should include(2)
ids.should_not include(3)
How can I do something like this?
I am responding with a few unsatisfactory solutions that I have found, but I would like to see the best.
source
share