From ce0c9d065bc26627f3c1fe43f1b130be1edabeb6 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Wed, 28 Jun 2023 10:56:19 +0100 Subject: [PATCH] Reimport offered (#1731) * Add method for importing the 'offered' field into already imported lettings logs * Add minimal tests * feat: update tests * feat: update take task * feat: update rake task * feat: update rake task * feat: update rake task spec --------- Co-authored-by: Rachael Booth --- lib/tasks/data_import_field.rake | 2 +- spec/lib/tasks/date_import_field_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/data_import_field.rake b/lib/tasks/data_import_field.rake index ba389d317..29512761d 100644 --- a/lib/tasks/data_import_field.rake +++ b/lib/tasks/data_import_field.rake @@ -9,7 +9,7 @@ namespace :core do # We only allow a reduced list of known fields to be updatable case field - when "tenant_code", "major_repairs", "lettings_allocation" + when "tenancycode", "major_repairs", "lettings_allocation", "offered" Imports::LettingsLogsFieldImportService.new(storage_service).update_field(field, path) else raise "Field #{field} cannot be updated by data_import_field" diff --git a/spec/lib/tasks/date_import_field_spec.rb b/spec/lib/tasks/date_import_field_spec.rb index 6c7cc9943..1ed2d0073 100644 --- a/spec/lib/tasks/date_import_field_spec.rb +++ b/spec/lib/tasks/date_import_field_spec.rb @@ -28,8 +28,8 @@ describe "rake core:data_import_field", type: :task do allow(import_service).to receive(:update_field) end - context "and we update the tenant_code field" do - let(:field) { "tenant_code" } + context "and we update the tenancycode field" do + let(:field) { "tenancycode" } it "properly configures the storage service" do expect(Storage::S3Service).to receive(:new).with(paas_config_service, instance_name)