Browse Source

Sales remove question 9

pull/2754/head
Manny Dinssa 8 months ago
parent
commit
7f38e1bc62
  1. 2
      app/models/form/sales/subsections/setup.rb
  2. 6
      config/locales/forms/2025/sales/setup.en.yml
  3. 34
      spec/models/form/sales/subsections/setup_spec.rb

2
app/models/form/sales/subsections/setup.rb

@ -16,7 +16,7 @@ class Form::Sales::Subsections::Setup < ::Form::Subsection
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::BuyerCompany.new(nil, nil, self),
(Form::Sales::Pages::BuyerCompany.new(nil, nil, self) unless form.start_year_2025_or_later?),
Form::Sales::Pages::BuyerLive.new(nil, nil, self),
Form::Sales::Pages::JointPurchase.new(nil, nil, self),
Form::Sales::Pages::NumberJointBuyers.new(nil, nil, self),

6
config/locales/forms/2025/sales/setup.en.yml

@ -61,12 +61,6 @@ en:
hint_text: ""
question_text: "What type of sale is it?"
companybuy:
page_header: ""
check_answer_label: "Company buyer"
hint_text: ""
question_text: "Is the buyer a company?"
buylivein:
page_header: ""
check_answer_label: "Buyers living in property"

34
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[
owning_organisation
managing_organisation
assigned_to
completion_date
purchaser_code
ownership_scheme
shared_ownership_type
discounted_ownership_type
outright_ownership_type
buyer_live
joint_purchase
number_joint_buyers
buyer_interview_joint_purchase
buyer_interview
privacy_notice_joint_purchase
privacy_notice
],
)
end
end
end

Loading…
Cancel
Save