1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/factories/passport_maps.rb

22 lines
640 B
Ruby
Raw Normal View History

2018-12-02 09:16:16 -05:00
# frozen_string_literal: true
FactoryBot.define do
factory :passport_map do
2018-12-02 11:44:02 -05:00
association :passport, factory: :empty_passport
2018-12-02 09:16:16 -05:00
2019-03-26 16:18:21 -04:00
first_name { Faker::Name.first_name }
middle_name { Faker::Name.first_name }
last_name { Faker::Name.last_name }
2018-12-02 09:41:48 -05:00
sex { PassportMap.sexes.keys.sample }
2018-12-02 09:16:16 -05:00
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')}"
end
date_of_issue { Faker::Date.backward }
end
end