From ac928adcd7ecde59ef01221af42d530eb4eadf0d Mon Sep 17 00:00:00 2001 From: Mo Seedat Date: Fri, 4 Nov 2022 00:05:50 +0000 Subject: [PATCH] Update failing tests --- .../form/sales/subsections/property_information_spec.rb | 1 + spec/models/form_handler_spec.rb | 4 ++-- .../imports/lettings_logs_field_import_service_spec.rb | 2 +- spec/services/imports/lettings_logs_import_service_spec.rb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/models/form/sales/subsections/property_information_spec.rb b/spec/models/form/sales/subsections/property_information_spec.rb index 284d0e02c..b012fd5e6 100644 --- a/spec/models/form/sales/subsections/property_information_spec.rb +++ b/spec/models/form/sales/subsections/property_information_spec.rb @@ -17,6 +17,7 @@ RSpec.describe Form::Sales::Subsections::PropertyInformation, type: :model do property_number_of_bedrooms property_building_type property_unit_type + postcode_known property_local_authority ], ) diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index 87a04487a..814dd23a7 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -61,14 +61,14 @@ RSpec.describe FormHandler do it "is able to load a current sales form" do form = form_handler.get_form("current_sales") expect(form).to be_a(Form) - expect(form.pages.count).to eq(41) + expect(form.pages.count).to eq(42) expect(form.name).to eq("2022_2023_sales") end it "is able to load a previous sales form" do form = form_handler.get_form("previous_sales") expect(form).to be_a(Form) - expect(form.pages.count).to eq(41) + expect(form.pages.count).to eq(42) expect(form.name).to eq("2021_2022_sales") end end diff --git a/spec/services/imports/lettings_logs_field_import_service_spec.rb b/spec/services/imports/lettings_logs_field_import_service_spec.rb index 685617041..b7bd0c5ca 100644 --- a/spec/services/imports/lettings_logs_field_import_service_spec.rb +++ b/spec/services/imports/lettings_logs_field_import_service_spec.rb @@ -30,7 +30,7 @@ RSpec.describe Imports::LettingsLogsFieldImportService do allow(FormHandler.instance).to receive(:get_form).with("previous_lettings").and_return(real_2021_2022_form) WebMock.stub_request(:get, /api.postcodes.io\/postcodes\/LS166FT/) - .to_return(status: 200, body: '{"status":200,"result":{"codes":{"admin_district":"E08000035"}}}', headers: {}) + .to_return(status: 200, body: '{"status":200,"result":{"outcode": "LS1","incode": "1AA6FT","codes":{"admin_district":"E08000035"}}}', headers: {}) # Stub the S3 file listing and download allow(storage_service).to receive(:list_files) diff --git a/spec/services/imports/lettings_logs_import_service_spec.rb b/spec/services/imports/lettings_logs_import_service_spec.rb index c74726216..2f4469cb2 100644 --- a/spec/services/imports/lettings_logs_import_service_spec.rb +++ b/spec/services/imports/lettings_logs_import_service_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Imports::LettingsLogsImportService do before do WebMock.stub_request(:get, /api.postcodes.io\/postcodes\/LS166FT/) - .to_return(status: 200, body: '{"status":200,"result":{"admin_district":"Westminster","codes":{"admin_district":"E08000035"}}}', headers: {}) + .to_return(status: 200, body: '{"status":200,"result":{"outcode": "LS1","incode": "1AA6FT","admin_district":"Westminster","codes":{"admin_district":"E08000035"}}}', headers: {}) allow(Organisation).to receive(:find_by).and_return(nil) allow(Organisation).to receive(:find_by).with(old_visible_id: organisation.old_visible_id.to_i).and_return(organisation)