Browse Source

Seed la data before links (#1435)

* seed la data before links

* lint

* Only seed LAs once for tests
pull/1438/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
c4cb2ecd2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      db/seeds.rb
  2. 3
      spec/spec_helper.rb

6
db/seeds.rb

@ -309,6 +309,12 @@ unless Rails.env.test?
pp "Seeded 3 dummy schemes" pp "Seeded 3 dummy schemes"
end 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? if (Rails.env.development? || Rails.env.review?) && LocalAuthorityLink.count.zero?
links_data_path = "config/local_authorities_data/local_authority_links_2023.csv" links_data_path = "config/local_authorities_data/local_authority_links_2023.csv"
service = Imports::LocalAuthorityLinksService.new(path: links_data_path) service = Imports::LocalAuthorityLinksService.new(path: links_data_path)

3
spec/spec_helper.rb

@ -113,6 +113,9 @@ RSpec.configure do |config|
config.before do config.before do
RequestHelper.stub_http_requests RequestHelper.stub_http_requests
end
config.before(:suite) do
Rails.application.load_seed Rails.application.load_seed
end end

Loading…
Cancel
Save