Browse Source

Update staircase page test with 2025

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

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

@ -7,23 +7,40 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do
let(:page_definition) { nil }
let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1))) }
before do
allow(subsection.form).to receive(:start_year_2025_or_later?).and_return(false)
end
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") }
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
before do
allow(subsection.form).to receive(:start_year_2025_or_later?).and_return(false)
end
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[staircase])
end
it "has correct subsection" do
expect(page.subsection).to eq(subsection)
end
it "has correct questions" do
expect(page.questions.map(&:id)).to eq(%w[staircase])
end
it "has the correct id" do
expect(page.id).to eq("staircasing")
it "has the correct id" do
expect(page.id).to eq("staircasing")
end
it "has the correct description" do
expect(page.description).to be_nil
end
end
it "has the correct description" do
expect(page.description).to be_nil
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

Loading…
Cancel
Save