|
|
|
|
@ -19,36 +19,8 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do
|
|
|
|
|
describe "pages" do |
|
|
|
|
let(:section) { instance_double(described_class, form: instance_double(Form)) } |
|
|
|
|
|
|
|
|
|
context "when 2022" do |
|
|
|
|
before do |
|
|
|
|
allow(form).to receive_messages(start_date: Time.zone.local(2022, 2, 8), start_year_2024_or_later?: false) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
|
expect(outright_sale.pages.compact.map(&:id)).to eq( |
|
|
|
|
%w[ |
|
|
|
|
purchase_price_outright_sale |
|
|
|
|
about_price_outright_sale_value_check |
|
|
|
|
mortgage_used_outright_sale |
|
|
|
|
outright_sale_mortgage_used_mortgage_value_check |
|
|
|
|
mortgage_amount_outright_sale |
|
|
|
|
outright_sale_mortgage_amount_mortgage_value_check |
|
|
|
|
mortgage_lender_outright_sale |
|
|
|
|
mortgage_lender_other_outright_sale |
|
|
|
|
mortgage_length_outright_sale |
|
|
|
|
extra_borrowing_outright_sale |
|
|
|
|
deposit_outright_sale |
|
|
|
|
outright_sale_deposit_joint_purchase_value_check |
|
|
|
|
outright_sale_deposit_value_check |
|
|
|
|
monthly_charges_outright_sale_value_check |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when 2023" do |
|
|
|
|
before do |
|
|
|
|
allow(form).to receive_messages(start_date: Time.zone.local(2023, 2, 8), start_year_2024_or_later?: false) |
|
|
|
|
allow(form).to receive_messages(start_date: Time.zone.local(2024, 2, 8)) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
|
@ -60,8 +32,6 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do
|
|
|
|
|
outright_sale_mortgage_used_mortgage_value_check |
|
|
|
|
mortgage_amount_outright_sale |
|
|
|
|
outright_sale_mortgage_amount_mortgage_value_check |
|
|
|
|
mortgage_lender_outright_sale |
|
|
|
|
mortgage_lender_other_outright_sale |
|
|
|
|
mortgage_length_outright_sale |
|
|
|
|
extra_borrowing_outright_sale |
|
|
|
|
deposit_outright_sale |
|
|
|
|
@ -74,33 +44,6 @@ RSpec.describe Form::Sales::Subsections::OutrightSale, type: :model do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when 2024" do |
|
|
|
|
before do |
|
|
|
|
allow(form).to receive_messages(start_date: Time.zone.local(2024, 2, 8), start_year_2024_or_later?: true) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
|
expect(outright_sale.pages.map(&:id)).to eq( |
|
|
|
|
%w[ |
|
|
|
|
purchase_price_outright_sale |
|
|
|
|
about_price_outright_sale_value_check |
|
|
|
|
mortgage_used_outright_sale |
|
|
|
|
outright_sale_mortgage_used_mortgage_value_check |
|
|
|
|
mortgage_amount_outright_sale |
|
|
|
|
outright_sale_mortgage_amount_mortgage_value_check |
|
|
|
|
mortgage_length_outright_sale |
|
|
|
|
extra_borrowing_outright_sale |
|
|
|
|
deposit_outright_sale |
|
|
|
|
outright_sale_deposit_joint_purchase_value_check |
|
|
|
|
outright_sale_deposit_value_check |
|
|
|
|
leasehold_charges_outright_sale |
|
|
|
|
monthly_charges_outright_sale_value_check |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has the correct id" do |
|
|
|
|
expect(outright_sale.id).to eq("outright_sale") |
|
|
|
|
end |
|
|
|
|
|