Browse Source

Only blank tenancy length when it is invalid for tenancy type (#1902)

* Only blank tenancy lenght when it is invalid for tenancy type

* Update spec/services/imports/lettings_logs_import_service_spec.rb

Co-authored-by: natdeanlewissoftwire <94526761+natdeanlewissoftwire@users.noreply.github.com>

---------

Co-authored-by: natdeanlewissoftwire <94526761+natdeanlewissoftwire@users.noreply.github.com>
pull/1908/head
kosiakkatrina 1 year ago committed by GitHub
parent
commit
bda7bc7d08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/services/imports/lettings_logs_import_service.rb
  2. 4
      spec/services/imports/lettings_logs_import_service_spec.rb

2
app/services/imports/lettings_logs_import_service.rb

@ -312,7 +312,7 @@ module Imports
%i[chcharge out_of_range] => %w[chcharge],
%i[referral internal_transfer_non_social_housing] => %w[referral],
%i[referral internal_transfer_fixed_or_lifetime] => %w[referral],
%i[tenancylength tenancylength_invalid] => %w[tenancylength tenancy],
%i[tenancylength tenancylength_invalid] => %w[tenancylength],
%i[prevten over_25_foster_care] => %w[prevten age1],
%i[prevten non_temp_accommodation] => %w[prevten rsnvac],
%i[joint not_joint_tenancy] => %w[joint],

4
spec/services/imports/lettings_logs_import_service_spec.rb

@ -325,7 +325,7 @@ RSpec.describe Imports::LettingsLogsImportService do
.not_to raise_error
end
it "clears out the invalid answers" do
it "clears out the invalid tenancy length" do
allow(logger).to receive(:warn)
lettings_log_service.send(:create_log, lettings_log_xml)
@ -333,7 +333,7 @@ RSpec.describe Imports::LettingsLogsImportService do
expect(lettings_log).not_to be_nil
expect(lettings_log.tenancylength).to be_nil
expect(lettings_log.tenancy).to be_nil
expect(lettings_log.tenancy).to eq(4)
end
end

Loading…
Cancel
Save