Tag: factory_girl
group :test do gem 'factory_girl_rails' gem 'rails3-generators' end
require 'factory_girl' FactoryGirl.define do factory :user do name 'John Doe' date_of_birth { 21.years.ago } end end
test/factories.rb spec/factories.rb test/factories/*.rb spec/factories/*.rb
FactoryGirl.create(:user)
bundle exec rake db:test:prepare
RSpec.configure do |config| config.include FactoryGirl::Syntax::Methods end
Spork.each_run do # This code will be run each time you run your specs. FactoryGirl.reload end