Let me make it clear more info on Howto girl

The capabilities are introduced by this tutorial of factory-girl . We are going to begin with a easy factory for the hypothetical consumer model and slowly enhance it. This guide may well not protect every aspect of factory-girl , but should act as a good kick off point.

An Individual Factory

Why don’t we begin with a easy user factory, once we continue, we are going to carry on changing this factory to incorporate functionality and show just exactly exactly how factory-girl works.

If we require a person item now, we could just ask factory-girl to construct one for people. Which is awesome, although not very helpful yet. Most of the things we get back from factory-girl now have same home values.

The build api enables us to pass through characteristics to bypass standard ones, therefore we may do:

Once more, this can be handy, yet not invaluable, it needs us to help keep supplying an email that is new each and every time you want to produce a person model.

factory-girl has a remedy: sequences. As opposed to supplying a value that is hardcoded we are able to inform factory-girl to alternatively work with a series. Continue reading