Adding better fake seed data

This commit is contained in:
Jason Denney
2013-11-03 13:52:43 -05:00
parent 3ba443397e
commit d0b2144b28
6 changed files with 31 additions and 23 deletions
+11 -11
View File
@@ -4,17 +4,17 @@ FactoryGirl.define do
factory :bike do
sequence(:shop_id) {|n| n}
sequence :serial_number do |n|
"S/N# #{n}"
"#{Faker::Code.isbn}-#{n}"
end
bike_brand_id 1
bike_model_id 1
color "FFFFFF"
bike_style_id 1
seat_tube_height 5
top_tube_length 6
bike_wheel_size_id 1
value 100
bike_condition_id 1
bike_purpose_id 1
bike_brand_id { Random.rand(100) }
model { Faker::Commerce.product_name }
color { sprintf("%06X", Random.rand(16777215) ) }
bike_style_id { Random.rand(2) }
seat_tube_height { Random.rand(25) }
top_tube_length { Random.rand(25) }
bike_wheel_size_id { Random.rand(10) }
value { Random.rand(200) }
bike_condition_id { Random.rand(2) }
bike_purpose_id { Random.rand(2) }
end
end
+6 -6
View File
@@ -1,11 +1,11 @@
FactoryGirl.define do
factory :user_profile do
user_id 1
addrStreet1 "Charles Street"
addrStreet2 "Apt #42"
addrCity "Baltimore"
addrState "MD"
addrZip "21231"
phone "(410)8675309"
addrStreet1 { Faker::Address.street_address }
addrStreet2 { Faker::Address.secondary_address }
addrCity { Faker::Address.city }
addrState { Faker::Address.state_abbr }
addrZip { Faker::Address.zip_code }
phone { Faker::PhoneNumber.cell_phone }
end
end
+1
View File
@@ -1,5 +1,6 @@
FactoryGirl.define do
factory :user do
sequence(:username) { |n| "user_#{n}" }
sequence(:email) { |n| "user_#{n}@example.com" }
password 'password'