2018-11-29 20:19:38 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
2018-12-02 11:44:02 -05:00
|
|
|
factory :empty_passport, class: Passport do
|
2019-07-22 09:52:23 -04:00
|
|
|
association :person, factory: :initial_person
|
|
|
|
association :federal_subject, factory: :federal_subject
|
2019-01-30 22:04:42 -05:00
|
|
|
|
2019-07-18 14:44:46 -04:00
|
|
|
first_name { Faker::Name.first_name }
|
|
|
|
middle_name { Faker::Name.first_name }
|
|
|
|
last_name { Faker::Name.last_name }
|
|
|
|
sex { Passport.sexes.keys.sample }
|
|
|
|
date_of_birth { Faker::Date.backward }
|
|
|
|
place_of_birth { Faker::Address.city }
|
|
|
|
series { rand 0..9999 }
|
|
|
|
number { rand 0..999_999 }
|
|
|
|
issued_by { Faker::Lorem.sentence }
|
|
|
|
unit_code do
|
|
|
|
"#{rand(0..999).to_s.rjust(3, '0')}-#{rand(0..999).to_s.rjust(3, '0')}"
|
2018-12-02 11:44:02 -05:00
|
|
|
end
|
2019-07-18 14:44:46 -04:00
|
|
|
date_of_issue { Faker::Date.backward }
|
2019-07-22 09:52:23 -04:00
|
|
|
|
|
|
|
zip_code { Faker::Address.zip_code }
|
|
|
|
|
|
|
|
town_type { 'город' }
|
|
|
|
town_name { Faker::Address.city }
|
|
|
|
settlement_type { 'посёлок' }
|
|
|
|
settlement_name { Faker::Address.city }
|
|
|
|
district_type { 'район' }
|
|
|
|
district_name { Faker::Address.community }
|
|
|
|
street_type { 'улица' }
|
|
|
|
street_name { Faker::Address.street_name }
|
|
|
|
residence_type { 'дом' }
|
|
|
|
residence_name { Faker::Address.building_number }
|
|
|
|
building_type { 'строение' }
|
|
|
|
building_name { rand(1..3).to_s }
|
|
|
|
apartment_type { 'квартира' }
|
|
|
|
apartment_name { rand(1..150).to_s }
|
2018-12-02 09:24:28 -05:00
|
|
|
end
|
2018-11-29 20:19:38 -05:00
|
|
|
end
|