I am pretty new to factory_girl and I have the following problem.
I have a class say of the form:
class Fruit::Apple < ActiveRecord::Base
...
end
Suppose I need to create factories for this class. How should I do it? In other words is there a set_fixture_class equivalent for factories?
My apple_factory.rb is as follows:
FactoryGirl.define do |f|
factory 'apple' do
variety : washington
end
end
I have all the required gems and my folder structure is of the form test/factory/apple_factory.rb
. When I execute my tests I get uninitialized constant Apple
. Where do I set the class definition? Do I need to set a factory helper?