Browse Source

Update staircase page test with 2025

pull/2751/head
Manny Dinssa 1 year ago
parent
commit
201507887f
  1. 17
      spec/models/form/sales/pages/staircase_spec.rb

17
spec/models/form/sales/pages/staircase_spec.rb

@ -7,6 +7,9 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do
let(:page_definition) { nil } let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) } let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) }
context "when start year is 2024" do
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)), id: "sale_information") }
before do before do
allow(subsection.form).to receive(:start_year_2025_or_later?).and_return(false) allow(subsection.form).to receive(:start_year_2025_or_later?).and_return(false)
end end
@ -26,4 +29,18 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do
it "has the correct description" do it "has the correct description" do
expect(page.description).to be_nil expect(page.description).to be_nil
end end
end
context "when start year is >= 2025" do
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)), id: "setup") }
before do
allow(subsection.form).to receive(:start_year_2025_or_later?).and_return(true)
end
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
end
end end

Loading…
Cancel
Save