Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

CLDC-2069 Find UPRNs by address (#2278) * feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint * feat: build out alternative routes through the address lookup flow * refactor: lint * refactor: remove commented lines * feat: make nil safe * feat: test address client * feat: store address input separately * feat: add migration * feat: display inputs in answer label * feat: update data presenter and test * feat: revert precicions schema update * feat: revert precision schema update * feat: migrate new fields to sales logs * feat: update shared log examples tests * feat: use -1 for not listed address for extensibility * feat: add service error to address_selection * feat: handle case when no addresses are found * feat: allow re-entering different uprns * feat: improve error handling and don't accept "no match" precisions * feat: add page tests * feat: confirm uprn on address update * feat: add question tests * feat: don't set minimum match for initial search * feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint * feat: build out alternative routes through the address lookup flow * refactor: lint * refactor: remove commented lines * feat: make nil safe * feat: test address client * feat: store address input separately * feat: add migration * feat: display inputs in answer label * feat: update data presenter and test * feat: revert precision schema update * feat: migrate new fields to sales logs * feat: update shared log examples tests * feat: use -1 for not listed address for extensibility * feat: add service error to address_selection * feat: handle case when no addresses are found * feat: allow re-entering different uprns * feat: improve error handling and don't accept "no match" precisions * feat: add page tests * feat: confirm uprn on address update * feat: add question tests * feat: don't set minimum match for initial search * feat: add no address found page * feat: allow uprn known to be skipped, and set 0.4 min precision * feat: accept best "good" match in bulk upload * feat: update validations and test * refactor: avoid stubbing using any_instance_of * refactor: use change_table in migrations * feat: add lettings behaviour to sales logs * feat: update sales tests * feat: xit test that is xited in lettings * feat: stub os api in sales row parser * feat: stub os api in sales row parser * feat: add address line 1 to required attributes * feat: update matching details and fix row parser validation * refactor: improve readability * feat: set uprns as option IDs to avoid multiple lookups * feat: add sales uprn_selection * feat: update schema * feat: update tests * feat: remove redundant methods * feat: update error message and fix tests * feat: update tests * feat: update tests and error behaviour * feat: update tests
8 months ago
require "rails_helper"
RSpec.describe Form::Lettings::Pages::AddressMatcher, type: :model do
subject(:page) { described_class.new(page_id, page_definition, subsection) }
let(:page_id) { nil }
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection) }
let(:log) { create(:lettings_log) }
CLDC-2069 Find UPRNs by address (#2278) * feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint * feat: build out alternative routes through the address lookup flow * refactor: lint * refactor: remove commented lines * feat: make nil safe * feat: test address client * feat: store address input separately * feat: add migration * feat: display inputs in answer label * feat: update data presenter and test * feat: revert precicions schema update * feat: revert precision schema update * feat: migrate new fields to sales logs * feat: update shared log examples tests * feat: use -1 for not listed address for extensibility * feat: add service error to address_selection * feat: handle case when no addresses are found * feat: allow re-entering different uprns * feat: improve error handling and don't accept "no match" precisions * feat: add page tests * feat: confirm uprn on address update * feat: add question tests * feat: don't set minimum match for initial search * feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint * feat: build out alternative routes through the address lookup flow * refactor: lint * refactor: remove commented lines * feat: make nil safe * feat: test address client * feat: store address input separately * feat: add migration * feat: display inputs in answer label * feat: update data presenter and test * feat: revert precision schema update * feat: migrate new fields to sales logs * feat: update shared log examples tests * feat: use -1 for not listed address for extensibility * feat: add service error to address_selection * feat: handle case when no addresses are found * feat: allow re-entering different uprns * feat: improve error handling and don't accept "no match" precisions * feat: add page tests * feat: confirm uprn on address update * feat: add question tests * feat: don't set minimum match for initial search * feat: add no address found page * feat: allow uprn known to be skipped, and set 0.4 min precision * feat: accept best "good" match in bulk upload * feat: update validations and test * refactor: avoid stubbing using any_instance_of * refactor: use change_table in migrations * feat: add lettings behaviour to sales logs * feat: update sales tests * feat: xit test that is xited in lettings * feat: stub os api in sales row parser * feat: stub os api in sales row parser * feat: add address line 1 to required attributes * feat: update matching details and fix row parser validation * refactor: improve readability * feat: set uprns as option IDs to avoid multiple lookups * feat: add sales uprn_selection * feat: update schema * feat: update tests * feat: remove redundant methods * feat: update error message and fix tests * feat: update tests * feat: update tests and error behaviour * feat: update tests
8 months ago
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[address_line1_input postcode_full_input])
end
it "has the correct id" do
expect(page.id).to eq("address_matcher")
end
it "has the correct header" do
expect(page.header).to eq("Find an address")
end
it "has the correct description" do
expect(page.description).to be_nil
end
it "has correct depends_on" do
expect(page.depends_on).to eq([{ "is_supported_housing?" => false, "uprn_known" => nil }, { "is_supported_housing?" => false, "uprn_known" => 0 }, { "is_supported_housing?" => false, "uprn_confirmed" => 0 }])
end
it "has the correct skip_href" do
expect(page.skip_href(log)).to eq(
"/lettings-logs/#{log.id}/property-unit-type",
)
end
CLDC-2069 Find UPRNs by address (#2278) * feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint * feat: build out alternative routes through the address lookup flow * refactor: lint * refactor: remove commented lines * feat: make nil safe * feat: test address client * feat: store address input separately * feat: add migration * feat: display inputs in answer label * feat: update data presenter and test * feat: revert precicions schema update * feat: revert precision schema update * feat: migrate new fields to sales logs * feat: update shared log examples tests * feat: use -1 for not listed address for extensibility * feat: add service error to address_selection * feat: handle case when no addresses are found * feat: allow re-entering different uprns * feat: improve error handling and don't accept "no match" precisions * feat: add page tests * feat: confirm uprn on address update * feat: add question tests * feat: don't set minimum match for initial search * feat: mvp commit with address selector from address line 1 and postcode using OS places find endpoint * feat: build out alternative routes through the address lookup flow * refactor: lint * refactor: remove commented lines * feat: make nil safe * feat: test address client * feat: store address input separately * feat: add migration * feat: display inputs in answer label * feat: update data presenter and test * feat: revert precision schema update * feat: migrate new fields to sales logs * feat: update shared log examples tests * feat: use -1 for not listed address for extensibility * feat: add service error to address_selection * feat: handle case when no addresses are found * feat: allow re-entering different uprns * feat: improve error handling and don't accept "no match" precisions * feat: add page tests * feat: confirm uprn on address update * feat: add question tests * feat: don't set minimum match for initial search * feat: add no address found page * feat: allow uprn known to be skipped, and set 0.4 min precision * feat: accept best "good" match in bulk upload * feat: update validations and test * refactor: avoid stubbing using any_instance_of * refactor: use change_table in migrations * feat: add lettings behaviour to sales logs * feat: update sales tests * feat: xit test that is xited in lettings * feat: stub os api in sales row parser * feat: stub os api in sales row parser * feat: add address line 1 to required attributes * feat: update matching details and fix row parser validation * refactor: improve readability * feat: set uprns as option IDs to avoid multiple lookups * feat: add sales uprn_selection * feat: update schema * feat: update tests * feat: remove redundant methods * feat: update error message and fix tests * feat: update tests * feat: update tests and error behaviour * feat: update tests
8 months ago
end