diff --git a/app/models/form/lettings/questions/address_line1.rb b/app/models/form/lettings/questions/address_line1.rb index b3288c82c..4c8b4151b 100644 --- a/app/models/form/lettings/questions/address_line1.rb +++ b/app/models/form/lettings/questions/address_line1.rb @@ -9,15 +9,6 @@ class Form::Lettings::Questions::AddressLine1 < ::Form::Question @check_answer_label = "Q12 - Address" end - def hidden_in_check_answers?(log, _current_user = nil) - return true if log.uprn_known.nil? - return false if log.uprn_known&.zero? - return true if log.uprn_confirmed.nil? && log.uprn.present? - return true if log.uprn_known == 1 && log.uprn.blank? - - log.uprn_confirmed == 1 - end - def answer_label(log, _current_user = nil) [ log.address_line1, diff --git a/app/models/form/lettings/questions/la.rb b/app/models/form/lettings/questions/la.rb index b70e7590b..3cafda054 100644 --- a/app/models/form/lettings/questions/la.rb +++ b/app/models/form/lettings/questions/la.rb @@ -13,8 +13,4 @@ class Form::Lettings::Questions::La < ::Form::Question def answer_options { "" => "Select an option" }.merge(LocalAuthority.active(form.start_date).england.map { |la| [la.code, la.name] }.to_h) end - - def hidden_in_check_answers?(log, _current_user = nil) - log.startdate && log.startdate.year >= 2023 && log.is_la_inferred? - end end diff --git a/spec/models/form/lettings/questions/la_spec.rb b/spec/models/form/lettings/questions/la_spec.rb index 8f0008d7e..5f8d650f4 100644 --- a/spec/models/form/lettings/questions/la_spec.rb +++ b/spec/models/form/lettings/questions/la_spec.rb @@ -310,34 +310,4 @@ RSpec.describe Form::Lettings::Questions::La, type: :model do "E06000065" => "North Yorkshire", }) end - - describe "has the correct hidden_in_check_answers" do - context "when saledate.year before 2023" do - let(:log) { build(:lettings_log, startdate: Time.zone.parse("2022-07-01")) } - - it "returns false" do - expect(question.hidden_in_check_answers?(log)).to eq(false) - end - end - - context "when saledate.year >= 2023" do - let(:log) { build(:lettings_log, startdate: Time.zone.parse("2023-07-01")) } - - it "returns true" do - expect(question.hidden_in_check_answers?(log)).to eq(false) - end - end - - context "when saledate.year >= 2023 and la inferred" do - let(:log) { build(:lettings_log, startdate: Time.zone.parse("2023-07-01")) } - - before do - allow(log).to receive(:is_la_inferred?).and_return(true) - end - - it "returns true" do - expect(question.hidden_in_check_answers?(log)).to eq(true) - end - end - end end