diff --git a/app/models/form/sales/subsections/setup.rb b/app/models/form/sales/subsections/setup.rb index e5b5b3f84..b0c7025c7 100644 --- a/app/models/form/sales/subsections/setup.rb +++ b/app/models/form/sales/subsections/setup.rb @@ -15,7 +15,7 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection Form::Sales::Pages::OwnershipScheme.new(nil, nil, self), Form::Sales::Pages::SharedOwnershipType.new(nil, nil, self), Form::Sales::Pages::DiscountedOwnershipType.new(nil, nil, self), - Form::Sales::Pages::OutrightOwnershipType.new(nil, nil, self), + (Form::Sales::Pages::OutrightOwnershipType.new(nil, nil, self) unless form.start_year_2025_or_later?), Form::Sales::Pages::BuyerCompany.new(nil, nil, self), Form::Sales::Pages::BuyerLive.new(nil, nil, self), Form::Sales::Pages::JointPurchase.new(nil, nil, self), diff --git a/config/locales/forms/2025/sales/setup.en.yml b/config/locales/forms/2025/sales/setup.en.yml index 4f00ab0c2..105d0ad0d 100644 --- a/config/locales/forms/2025/sales/setup.en.yml +++ b/config/locales/forms/2025/sales/setup.en.yml @@ -50,16 +50,6 @@ en: check_answer_label: "Type of discounted ownership sale" hint_text: "" question_text: "What is the type of discounted ownership sale?" - outright_ownership: - page_header: "Type of outright sale" - type: - check_answer_label: "Type of outright sale" - hint_text: "" - question_text: "What is the type of outright sale?" - othtype: - check_answer_label: "Type of other sale" - hint_text: "" - question_text: "What type of sale is it?" companybuy: page_header: "" diff --git a/spec/models/form/sales/subsections/setup_spec.rb b/spec/models/form/sales/subsections/setup_spec.rb index 1e49d11e6..1cd363105 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 @@ -46,9 +47,10 @@ 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) end it "has correct pages" do @@ -75,4 +77,34 @@ 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[ + completion_date + owning_organisation + managing_organisation + assigned_to + purchaser_code + ownership_scheme + shared_ownership_type + discounted_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