|
|
@ -5,7 +5,8 @@ RSpec.describe Form::Lettings::Questions::AddressSearch, type: :model do |
|
|
|
|
|
|
|
|
|
|
|
let(:question_id) { nil } |
|
|
|
let(:question_id) { nil } |
|
|
|
let(:question_definition) { nil } |
|
|
|
let(:question_definition) { nil } |
|
|
|
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2025, 4, 1)))) } |
|
|
|
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date:))) } |
|
|
|
|
|
|
|
let(:start_date) { Time.utc(2024, 4, 1) } |
|
|
|
|
|
|
|
|
|
|
|
it "has correct page" do |
|
|
|
it "has correct page" do |
|
|
|
expect(question.page).to eq(page) |
|
|
|
expect(question.page).to eq(page) |
|
|
@ -19,10 +20,18 @@ RSpec.describe Form::Lettings::Questions::AddressSearch, type: :model do |
|
|
|
expect(question.type).to eq("address_search") |
|
|
|
expect(question.type).to eq("address_search") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "has the correct question_number" do |
|
|
|
it "has the correct question number" do |
|
|
|
expect(question.question_number).to eq(12) |
|
|
|
expect(question.question_number).to eq(12) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "with 2025/26 form" do |
|
|
|
|
|
|
|
let(:start_date) { Time.utc(2025, 4, 1) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has the correct question number" do |
|
|
|
|
|
|
|
expect(question.question_number).to eq(16) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe "get_extra_check_answer_value" do |
|
|
|
describe "get_extra_check_answer_value" do |
|
|
|
context "when address is not present" do |
|
|
|
context "when address is not present" do |
|
|
|
let(:log) { build(:lettings_log, manual_address_entry_selected: false) } |
|
|
|
let(:log) { build(:lettings_log, manual_address_entry_selected: false) } |
|
|
|