our test code is currently using factory_girl and I am trying to use fabrication for my tests to generate objects.
In Factory_Girl
batch = FactoryGirl.create(:transaction_batch)
puts batch # print out a transaction object
In Factory Girls
batch = Fabricator(:transaction_batch)
puts batch # prints out an empty array
Could anyone tell me why the Fabricator is returning an empty array?
The
FactoryGirldefines it's factories inspec/factories/transaction.rb, and there you have something like this:The
Fabricatoruses "fabrications" from a different location, likespec/fabricators/transaction_fabricator.rbAnd there you don't have defined fabrication. That is the reason, or you have a blank fabrication like:
Create a fabrication for Fabricator, and you should be fine.