diff --git a/db/seeds.rb b/db/seeds.rb index f57bb85d7..bf43d47b1 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -309,6 +309,12 @@ unless Rails.env.test? pp "Seeded 3 dummy schemes" end + if LocalAuthority.count.zero? + la_path = "config/local_authorities_data/initial_local_authorities.csv" + service = Imports::LocalAuthoritiesService.new(path: la_path) + service.call + end + if (Rails.env.development? || Rails.env.review?) && LocalAuthorityLink.count.zero? links_data_path = "config/local_authorities_data/local_authority_links_2023.csv" service = Imports::LocalAuthorityLinksService.new(path: links_data_path) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 72083e6a9..9677a128c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -113,6 +113,9 @@ RSpec.configure do |config| config.before do RequestHelper.stub_http_requests + end + + config.before(:suite) do Rails.application.load_seed end