mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
Adding better fake seed data
This commit is contained in:
+11
-11
@@ -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
|
||||
|
||||
@@ -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,5 +1,6 @@
|
||||
FactoryGirl.define do
|
||||
factory :user do
|
||||
|
||||
sequence(:username) { |n| "user_#{n}" }
|
||||
sequence(:email) { |n| "user_#{n}@example.com" }
|
||||
password 'password'
|
||||
|
||||
Reference in New Issue
Block a user