Created
April 19, 2010 19:19
-
-
Save hosh/371461 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'machinist/active_record' | |
require 'sham' | |
require 'faker' | |
# The one below is from an older version. In my newer version that works with rspec2, | |
# blueprints.rb is located in spec/support and the line below matches that. The advantage | |
# is that the generated spec_helper automatically loads anything under spec/support | |
require File.expand_path('blueprints.rb', File.dirname(__FILE__) + '/../spec/') | |
puts '', "Accounts ..." | |
account = Account.make | |
puts account.name | |
puts '', "Manufacturers ..." | |
5.times do | |
m = Manufacturer.make(:account => account) | |
puts m.name | |
end | |
puts '', "Merchants ..." | |
10.times do | |
m = Merchant.make(:account => account) | |
puts m.name | |
end | |
puts '', "Contacts ..." | |
3.times do | |
contact = Contact.make | |
account.account_contacts.create(:contact => contact) | |
puts "#{contact.last_name}, #{contact.first_name} <#{contact.email}>" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment