I’m designing a test around rails using Cucumber and Rspec and I was wondering if it is good practice sharing the Factory Girl factory code between the Cucumber acceptance test and Rspec unit tests.
And if it is good practice where would be the best place neutral location to place the factories for rspec and cucumber.
Thanks a lot
You can use factories anywhere you like. I generally use them in rspec and my Cucumber stories.
Factories are fixture replacements. General idea is to be able to right readable tests and move away from the “fixtures” hell scenario.
I think its fine if you place in spec/factories , there is no standard location. But I generally place it in my spec folder. No need to use a separate neutral location for it.