vendredi 28 septembre 2018

Rails form testing: post directly or through form?

Most examples of Rails tests I have seen post directly to a url. I found out recently that Rails supports the manipulation of form elements using 'fill_in' and 'click_on'.

Should I be posting directly or submitting through the forms manually? Filling in the forms manually seems much more thorough, and the reason I ask is, well, all the examples I've seen are posting directly. Obviously there may be a little less work with posting directly, but I'm curious what cases I might be missing. Is there a best practice?

Aucun commentaire:

Enregistrer un commentaire