← Back to Upcase

How to name integration tests?


(Paolo Paolo) #1

Is there any best practices or conventions to name the integration tests in rails?
Unit tests are named after the model, and therefore are easy to find and check. Integration tests are instead named after a feature, which is somehow arbitrary as far as its name is concerned.

In a reasonably large app I am currently maintaining (20k loc) it is very difficult to find the specific integratin tests related to each functionality, to the point that it is clear that bits and pieces of the same functionalities have been tested multiple times and some tests are even duplicated.

Thanks in advance.

Paolo


(Raul Murciano) #2

It’s difficult to say without knowing more about your app, can you some examples of duplication?

You may want to extract duplicated interactions/assertions as Josh does in the TDD workshop’s twitter app and reuse them across your integration tests, focusing those in different aspects of each specific feature.