|
|
|
@ -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 |
|
|
|
|