|
|
|
@ -5,11 +5,8 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do
|
|
|
|
|
|
|
|
|
|
let(:page_id) { nil } |
|
|
|
|
let(:page_definition) { nil } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection) } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1))) |
|
|
|
|
end |
|
|
|
|
let(:form) { instance_double(Form, start_year_2024_or_later?: false, start_date: Time.zone.local(2023, 4, 1)) } |
|
|
|
|
let(:subsection) { instance_double(Form::Subsection, enabled?: true, form:) } |
|
|
|
|
|
|
|
|
|
it "has correct subsection" do |
|
|
|
|
expect(page.subsection).to eq(subsection) |
|
|
|
@ -26,4 +23,46 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do
|
|
|
|
|
it "has the correct description" do |
|
|
|
|
expect(page.description).to be_nil |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with form year 2024" do |
|
|
|
|
let(:form) { Form.new(nil, 2024, [], "sales") } |
|
|
|
|
let(:saledate) { Time.zone.local(2024, 4, 1) } |
|
|
|
|
|
|
|
|
|
context "with a staircasing log" do |
|
|
|
|
let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } |
|
|
|
|
|
|
|
|
|
it "is routed to" do |
|
|
|
|
expect(page.routed_to?(log, nil)).to be true |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with a non-staircasing log" do |
|
|
|
|
let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 2, saledate:) } |
|
|
|
|
|
|
|
|
|
it "is routed to" do |
|
|
|
|
expect(page.routed_to?(log, nil)).to be true |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with form year 2025" do |
|
|
|
|
let(:form) { Form.new(nil, 2025, [], "sales") } |
|
|
|
|
let(:saledate) { Time.zone.local(2025, 4, 1) } |
|
|
|
|
|
|
|
|
|
context "with a staircasing log" do |
|
|
|
|
let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 1, saledate:) } |
|
|
|
|
|
|
|
|
|
it "is not routed to" do |
|
|
|
|
expect(page.routed_to?(log, nil)).to be false |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "with a non-staircasing log" do |
|
|
|
|
let(:log) { build(:sales_log, :shared_ownership_setup_complete, staircase: 2, saledate:) } |
|
|
|
|
|
|
|
|
|
it "is routed to" do |
|
|
|
|
expect(page.routed_to?(log, nil)).to be true |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|