Browse Source

Update failing tests

CLDC-1468-add-postcode-to-sales-property-info-journey
Mo Seedat 2 years ago
parent
commit
ac928adcd7
  1. 1
      spec/models/form/sales/subsections/property_information_spec.rb
  2. 4
      spec/models/form_handler_spec.rb
  3. 2
      spec/services/imports/lettings_logs_field_import_service_spec.rb
  4. 2
      spec/services/imports/lettings_logs_import_service_spec.rb

1
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
],
)

4
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

2
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)

2
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)

Loading…
Cancel
Save