samedi 24 octobre 2015

Should I use Rails routing helpers inside RSpec tests?

On RSpec Request doc page we can read that

Request specs provide a thin wrapper around Rails' integration tests, and are designed to drive behavior through the full stack, including routing (provided by Rails) and without stubbing (that's up to you).

and in the provided code example we see get "/widgets/new". However, we have access to all routes helper inside requests specs (like new_widget_path). I see that some projects use url helpers in specs, some not.

What is considered as best the practise? Can I use routing helpers inside integration (or / and ) feature tests? What consequences have each of these approaches?

Aucun commentaire:

Enregistrer un commentaire