From f8f55e1f64e9f82b1eb6a5024f59d4b66cd2fc50 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:26:00 +0000 Subject: [PATCH] Update setup tests --- .../form/sales/subsections/setup_spec.rb | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/spec/models/form/sales/subsections/setup_spec.rb b/spec/models/form/sales/subsections/setup_spec.rb index c1723f5c4..6cb70e23a 100644 --- a/spec/models/form/sales/subsections/setup_spec.rb +++ b/spec/models/form/sales/subsections/setup_spec.rb @@ -47,7 +47,7 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do end end - context "when start year is >= 2024" 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) @@ -77,4 +77,36 @@ RSpec.describe Form::Sales::Subsections::Setup, type: :model do ) end end + + context "when start year is >= 2025" 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(true) + end + + it "has correct pages" do + expect(setup.pages.map(&:id)).to eq( + %w[ + owning_organisation + managing_organisation + assigned_to + completion_date + purchaser_code + ownership_scheme + staircasing + shared_ownership_type + discounted_ownership_type + outright_ownership_type + buyer_company + buyer_live + joint_purchase + number_joint_buyers + buyer_interview_joint_purchase + buyer_interview + privacy_notice_joint_purchase + privacy_notice + ], + ) + end + end end