Skip to content

Instantly share code, notes, and snippets.

@croaky
Forked from qrush/training.rake
Created June 16, 2009 14:57
Show Gist options
  • Save croaky/130722 to your computer and use it in GitHub Desktop.
Save croaky/130722 to your computer and use it in GitHub Desktop.
# sudo gem install faker
desc "Load db with test data"
task :lorem => ['db:reset', :environment] do
require 'factory_girl'
require 'faker'
Factory.define :lorem_post, :class => :post do |post|
post.title { Faker::Lorem.sentence }
post.body { Faker::Lorem.paragraphs.join(' ') }
end
10.times { Factory(:lorem_post) }
end
# rake lorem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment