dimanche 2 août 2015

How to test if all divs with class one has also class two in Rails integration test?

I would like to test in my Rails integration test, if all divs with class one has also class two and if not, then fail.

There may be other classes, which are not relevant for this test.

This should pass:

<div class="one two">...</div>
<div class="one three two">...</div>
<div class="two one">...</div>

And this should fail:

<div class="one two">...</div>
<div class="one three">...</div>
<div class="one">...</div>

thx!

Aucun commentaire:

Enregistrer un commentaire