I am trying to use Factory Girl in a situation like this:
require 'factory_girl'
require File.expand_path("spec/factories.rb")
namespace :users do
desc "Create sample users for use in development"
task :create_sample_users => :environment do
Factory(:user, :email => "pending@acme.com")
Factory(:approved_user, :email => "user@acme.com")
end
end
However, when I start rake users:create_sample_users, I get an error message uninitialized constant Entry(Entry is the name of one of my application classes).
Can someone tell me how to get a Factory girl to see my classes? It works great in my tests, it just does not cope with my rake tasks.
source
share