Browse Source

CLDC-3715: Sales - Remove Q8 (What is the type of outright sale?) (25/26) (#2753)

test-branch-1
Manny Dinssa 2 months ago committed by GitHub
parent
commit
b681b101f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/models/form/sales/subsections/setup.rb
  2. 10
      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

@ -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),

10
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: ""

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[
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

Loading…
Cancel
Save