Browse Source

Replace removed bucket

pull/2112/head
Kat 2 years ago
parent
commit
96845bd009
  1. 4
      lib/tasks/import_address_from_csv.rake
  2. 2
      spec/lib/tasks/correct_address_from_csv_spec.rb

4
lib/tasks/import_address_from_csv.rake

@ -5,7 +5,7 @@ namespace :data_import do
raise "Usage: rake data_import:import_lettings_addresses_from_csv['csv_file_name']" if file_name.blank?
s3_service = Storage::S3Service.new(Configuration::EnvConfigurationService.new, ENV["IMPORT_PAAS_INSTANCE"])
s3_service = Storage::S3Service.new(Configuration::EnvConfigurationService.new, ENV["CSV_DOWNLOAD_PAAS_INSTANCE"])
file_io = s3_service.get_file_io(file_name)
file_io.set_encoding_by_bom
addresses_csv = CSV.parse(file_io, headers: true)
@ -69,7 +69,7 @@ namespace :data_import do
raise "Usage: rake data_import:import_sales_addresses_from_csv['csv_file_name']" if file_name.blank?
s3_service = Storage::S3Service.new(Configuration::EnvConfigurationService.new, ENV["IMPORT_PAAS_INSTANCE"])
s3_service = Storage::S3Service.new(Configuration::EnvConfigurationService.new, ENV["CSV_DOWNLOAD_PAAS_INSTANCE"])
file_io = s3_service.get_file_io(file_name)
file_io.set_encoding_by_bom
addresses_csv = CSV.parse(file_io, headers: true)

2
spec/lib/tasks/correct_address_from_csv_spec.rb

@ -13,7 +13,7 @@ RSpec.describe "data_import" do
allow(Storage::S3Service).to receive(:new).and_return(storage_service)
allow(Configuration::EnvConfigurationService).to receive(:new).and_return(env_config_service)
allow(ENV).to receive(:[])
allow(ENV).to receive(:[]).with("IMPORT_PAAS_INSTANCE").and_return(instance_name)
allow(ENV).to receive(:[]).with("CSV_DOWNLOAD_PAAS_INSTANCE").and_return(instance_name)
allow(ENV).to receive(:[]).with("VCAP_SERVICES").and_return("dummy")
WebMock.stub_request(:get, /api\.postcodes\.io/)

Loading…
Cancel
Save