|
|
|
@ -995,5 +995,17 @@ RSpec.describe SalesLog, type: :model do
|
|
|
|
|
expect(sales_log.reload.is_la_inferred).to eq(false) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe "#process_address_change!" do |
|
|
|
|
context "when uprn_selection is uprn_not_listed" do |
|
|
|
|
let(:log) { build(:sales_log, uprn_selection: "uprn_not_listed", address_line1_input: "Address line 1", postcode_full_input: "AA1 1AA") } |
|
|
|
|
|
|
|
|
|
it "sets log address fields, including postcode known" do |
|
|
|
|
expect { log.process_address_change! }.to change(log, :address_line1).from(nil).to("Address line 1") |
|
|
|
|
.and change(log, :postcode_full).from(nil).to("AA1 1AA") |
|
|
|
|
.and change(log, :pcodenk).from(nil).to(0) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
# rubocop:enable RSpec/MessageChain |
|
|
|
|