|
|
|
@ -6,6 +6,14 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do
|
|
|
|
|
let(:question_id) { nil } |
|
|
|
|
let(:question_definition) { nil } |
|
|
|
|
let(:page) { instance_double(Form::Page) } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection) } |
|
|
|
|
let(:form) { instance_double(Form) } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
allow(form).to receive(:start_date).and_return(Time.zone.local(2022, 4, 1)) |
|
|
|
|
allow(page).to receive(:subsection).and_return(subsection) |
|
|
|
|
allow(subsection).to receive(:form).and_return(form) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct page" do |
|
|
|
|
expect(question.page).to eq(page) |
|
|
|
@ -103,4 +111,14 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with collection year on or after 2023" do |
|
|
|
|
before do |
|
|
|
|
allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 4, 1)) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has the correct header" do |
|
|
|
|
expect(question.header).to eq("Which location is this letting for?") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|