Problem
You would like to test your factory_girl factories in the rails test console, but you get an error when you try to use an existing factory.
Solution
- Start your console in the test evnivornment:
rails c test
- require your factories.rb file in the console:
require 'absolute_path/to/your/factories.rb'
- you should be able to use your factory now :
t=Factory.create(:existing_factory_name)