Browse Source

More randomness in organisation generation

pull/2823/head
Rachael Booth 1 year ago
parent
commit
e04fe8cc12
  1. 6
      db/seeds.rb
  2. 10
      spec/factories/organisation.rb

6
db/seeds.rb

@ -1,10 +1,5 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Character.create(name: 'Luke', movie: movies.first)
def find_or_create_user(organisation, email, name, role)
case role
@ -53,6 +48,7 @@ unless Rails.env.test?
other_stock_owners: "None",
managing_agents_label: "None",
provider_type: "LA",
housing_registration_number: nil,
rent_periods: all_rent_periods,
)

10
spec/factories/organisation.rb

@ -1,11 +1,11 @@
FactoryBot.define do
factory :organisation do
name { "MHCLG" }
address_line1 { "2 Marsham Street" }
address_line2 { "London" }
name { Faker::Company.name }
address_line1 { Faker::Address.street_address }
address_line2 { Faker::Address.city }
provider_type { "LA" }
housing_registration_no { "1234" }
postcode { "SW1P 4DF" }
housing_registration_no { rand(99_999).to_s }
postcode { Faker::Address.postcode }
created_at { Time.zone.now }
updated_at { Time.zone.now }
holds_own_stock { true }

Loading…
Cancel
Save