diff --git a/db/seeds.rb b/db/seeds.rb index fcbb61b31..e08c90e04 100644 --- a/db/seeds.rb +++ b/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, ) diff --git a/spec/factories/organisation.rb b/spec/factories/organisation.rb index 376b9c126..ecab5bf81 100644 --- a/spec/factories/organisation.rb +++ b/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 }