Browse Source

Set uprn_known to 1 when setting UPRN

pull/1537/head
Jack S 3 years ago
parent
commit
fc38b316b0
  1. 1
      app/models/log.rb
  2. 1
      spec/models/lettings_log_spec.rb
  3. 1
      spec/models/sales_log_spec.rb

1
app/models/log.rb

@ -50,6 +50,7 @@ class Log < ApplicationRecord
presenter = UprnDataPresenter.new(service.result) presenter = UprnDataPresenter.new(service.result)
self.uprn_known = 1
self.uprn_confirmed = nil self.uprn_confirmed = nil
self.address_line1 = presenter.address_line1 self.address_line1 = presenter.address_line1
self.address_line2 = presenter.address_line2 self.address_line2 = presenter.address_line2

1
spec/models/lettings_log_spec.rb

@ -3139,6 +3139,7 @@ RSpec.describe LettingsLog do
.and change(lettings_log, :postcode_full).from(nil).to("POSTCODE") .and change(lettings_log, :postcode_full).from(nil).to("POSTCODE")
.and change(lettings_log, :uprn_confirmed).from(1).to(nil) .and change(lettings_log, :uprn_confirmed).from(1).to(nil)
.and change(lettings_log, :county).from("county").to(nil) .and change(lettings_log, :county).from("county").to(nil)
.and change(lettings_log, :uprn_known).from(nil).to(1)
end end
end end

1
spec/models/sales_log_spec.rb

@ -558,6 +558,7 @@ RSpec.describe SalesLog, type: :model do
.and change(sales_log, :postcode_full).from(nil).to("POSTCODE") .and change(sales_log, :postcode_full).from(nil).to("POSTCODE")
.and change(sales_log, :uprn_confirmed).from(1).to(nil) .and change(sales_log, :uprn_confirmed).from(1).to(nil)
.and change(sales_log, :county).from("county").to(nil) .and change(sales_log, :county).from("county").to(nil)
.and change(sales_log, :uprn_known).from(nil).to(1)
end end
end end

Loading…
Cancel
Save