mardi 7 juin 2016

Rails testing, have a setup only for some tests

We are writing tests to a Rails application and we need to test a controller where we pass a header for almost every request, but not all.

You pass a header setting @request.headers['my-header'] = 'my-header-content', but we only want to do this in some tests, not all, so having this line in setup is not an option, but we consider incorrect to have it repeated 20 or 30 times for every request made.

How could we achieve that?

Aucun commentaire:

Enregistrer un commentaire