Browse Source

Add comments

CLDC-4159-address-uprn-for-supported-housing
oscar-richardson-softwire 3 days ago
parent
commit
d7bd4741fc
  1. 2
      app/models/lettings_log.rb
  2. 4
      spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb

2
app/models/lettings_log.rb

@ -190,7 +190,7 @@ class LettingsLog < Log
location.linked_local_authorities.active(form.start_date).first&.code || location.location_code
end
def postcode_full
def postcode_full # TODO: CLDC-4119: Beware! This method may cause issues when testing supported housing log duplicate detection after postcode is added, as it can return `location.postcode` instead of the actual `postcode_full` stored on the log record (`super`). If this happens, investigate why it isn't returning `super`, as it should when `form.start_year_2026_or_later? && super`.
return super unless location
return super if form.start_year_2026_or_later? && super

4
spec/services/bulk_upload/lettings/year2026/row_parser_spec.rb

@ -296,7 +296,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do
:field_13, # tenancycode
:field_23, # postcode_full
:field_24, # postcode_full
:field_25, # postcode_full
:field_25, # LA
:field_42, # age1
:field_43, # sex1
:field_46, # ecstat1
@ -327,7 +327,7 @@ RSpec.describe BulkUpload::Lettings::Year2026::RowParser do
end
end
context "when a supported housing log already exists in the db" do
context "when a supported housing log already exists in the db" do # TODO: CLDC-4119: Beware! The `postcode_full` method in the `LettingsLog` class may cause issues with these supported housing log duplicate detection tests after postcode is added. See comment on the `postcode_full` method for details.
let(:attributes) { valid_attributes.merge({ field_4: "2", field_5: "S#{scheme.id}", field_6: location.old_visible_id, field_36: 3, field_122: 0 }) }
before do

Loading…
Cancel
Save