jeudi 8 janvier 2015

Assert text existence in Rails functional tests for views

To make tests less brittle, I don't want to use assert_select, eg:



assert_select 'h2.subtitle', shipment.vessel_name


This is too close to implementation, if I change the h2 to h3, my test will fail. I would like something like Capybara#assert_text:



assert_text shipment.vessel_name


that just makes sure the vessel name is display on the page.


Aucun commentaire:

Enregistrer un commentaire