Browse Source

Add additional randomness to log factories

pull/2817/head
Rachael Booth 6 months ago
parent
commit
e619fd2962
  1. 12
      spec/factories/lettings_log.rb
  2. 20
      spec/factories/sales_log.rb

12
spec/factories/lettings_log.rb

@ -56,8 +56,8 @@ FactoryBot.define do
status { 2 }
tenancycode { Faker::Name.initials(number: 10) }
age1_known { 0 }
age1 { 35 }
sex1 { "F" }
age1 { Faker::Number.within(range: 25..55) }
sex1 { %w[F M X R].sample }
ethnic_group { 0 }
ethnic { 2 }
national { 13 }
@ -67,8 +67,8 @@ FactoryBot.define do
relat2 { "P" }
age2_known { 0 }
details_known_2 { 0 }
age2 { 32 }
sex2 { "M" }
age2 { Faker::Number.within(range: 25..55) }
sex2 { %w[F M X R].sample }
ecstat2 { 6 }
homeless { 1 }
underoccupation_benefitcap { 0 }
@ -162,8 +162,8 @@ FactoryBot.define do
referral { 2 }
uprn_known { 0 }
joint { 3 }
address_line1 { "Address line 1" }
town_or_city { "London" }
address_line1 { Faker::Address.street_address }
town_or_city { Faker::Address.city }
ppcodenk { 1 }
tshortfall_known { 1 }
after(:build) do |log, _evaluator|

20
spec/factories/sales_log.rb

@ -78,14 +78,14 @@ FactoryBot.define do
noint { 2 }
privacynotice { 1 }
age1_known { 0 }
age1 { 30 }
sex1 { "X" }
age1 { Faker::Number.within(range: 25..55) }
sex1 { %w[F M X R].sample }
national { 18 }
buy1livein { 1 }
relat2 { "P" }
proptype { 1 }
age2_known { 0 }
age2 { 35 }
age2 { Faker::Number.within(range: 25..55) }
builtype { 1 }
ethnic { 3 }
ethnic_group { 17 }
@ -114,17 +114,17 @@ FactoryBot.define do
income2 { 10_000 }
inc2mort { 1 }
uprn_known { 0 }
address_line1 { "Address line 1" }
town_or_city { "Town or city" }
address_line1 { Faker::Address.street_address }
town_or_city { Faker::Address.city }
la_known { 1 }
la { "E09000003" }
savingsnk { 1 }
prevown { 1 }
prevshared { 2 }
sex3 { "X" }
sex4 { "X" }
sex5 { "X" }
sex6 { "X" }
sex3 { %w[F M X R].sample }
sex4 { %w[F M X R].sample }
sex5 { %w[F M X R].sample }
sex6 { %w[F M X R].sample }
mortgage { 20_000 }
ecstat3 { 9 }
ecstat4 { 3 }
@ -155,7 +155,7 @@ FactoryBot.define do
mscharge { 100 }
mortlen { 10 }
pcodenk { 0 }
postcode_full { "SW1A 1AA" }
postcode_full { Faker::Address.postcode }
is_la_inferred { false }
mortgagelender { 5 }
extrabor { 1 }

Loading…
Cancel
Save