|
|
|
@ -1018,6 +1018,33 @@ RSpec.describe "Lettings Log Features" do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and the user selects 'address_not_listed' when partial postcode is entered" do |
|
|
|
|
before do |
|
|
|
|
fill_in("lettings_log[address_line1_input]", with: "Address line 1") |
|
|
|
|
fill_in("lettings_log[postcode_full_input]", with: "AA1") |
|
|
|
|
click_button("Search") |
|
|
|
|
choose "The address is not listed, I want to enter the address manually" |
|
|
|
|
click_button("Save and continue") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "sets correct address fields" do |
|
|
|
|
lettings_log.reload |
|
|
|
|
expect(lettings_log.uprn_known).to eq(0) # no |
|
|
|
|
expect(lettings_log.uprn).to eq(nil) |
|
|
|
|
expect(lettings_log.uprn_confirmed).to eq(nil) |
|
|
|
|
expect(lettings_log.uprn_selection).to eq("uprn_not_listed") |
|
|
|
|
expect(lettings_log.postcode_known).to eq(nil) |
|
|
|
|
expect(lettings_log.postcode_full).to eq(nil) |
|
|
|
|
expect(lettings_log.address_line1).to eq("Address line 1") |
|
|
|
|
expect(lettings_log.address_line2).to eq(nil) |
|
|
|
|
expect(lettings_log.town_or_city).to eq(nil) |
|
|
|
|
expect(lettings_log.address_line1_input).to eq("Address line 1") |
|
|
|
|
expect(lettings_log.postcode_full_input).to eq("AA1") |
|
|
|
|
expect(lettings_log.address_search_value_check).to eq(nil) |
|
|
|
|
expect(lettings_log.la).to eq(nil) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and the user selects 'address_not_listed' and then changes their mind and selects an address" do |
|
|
|
|
before do |
|
|
|
|
fill_in("lettings_log[address_line1_input]", with: "Address line 1") |
|
|
|
|