diff --git a/spec/models/form/sales/pages/staircase_spec.rb b/spec/models/form/sales/pages/staircase_spec.rb index 89699f7e8..4a2899c43 100644 --- a/spec/models/form/sales/pages/staircase_spec.rb +++ b/spec/models/form/sales/pages/staircase_spec.rb @@ -5,7 +5,11 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1), start_year_2025_or_later?: false)) } + 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 it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/subsections/setup_spec.rb b/spec/models/form/sales/subsections/setup_spec.rb index 70d52977f..c1723f5c4 100644 --- a/spec/models/form/sales/subsections/setup_spec.rb +++ b/spec/models/form/sales/subsections/setup_spec.rb @@ -23,6 +23,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do context "when start year is before 2024" do before do allow(section.form).to receive(:start_year_2024_or_later?).and_return(false) + allow(section.form).to receive(:start_year_2025_or_later?).and_return(false) end it "has correct pages" do @@ -49,6 +50,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do context "when start year is >= 2024" do before do allow(section.form).to receive(:start_year_2024_or_later?).and_return(true) + allow(section.form).to receive(:start_year_2025_or_later?).and_return(false) end it "has correct pages" do