|
|
|
|
@ -11,26 +11,59 @@ RSpec.describe Form::Sales::Subsections::IncomeBenefitsAndSavings, type: :model
|
|
|
|
|
expect(subsection.section).to eq(section) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
|
expect(subsection.pages.map(&:id)).to eq( |
|
|
|
|
%w[ |
|
|
|
|
buyer_1_income |
|
|
|
|
buyer_1_income_value_check |
|
|
|
|
buyer_1_income_mortgage_value_check |
|
|
|
|
buyer_1_mortgage |
|
|
|
|
buyer_1_mortgage_value_check |
|
|
|
|
buyer_2_income |
|
|
|
|
buyer_2_income_mortgage_value_check |
|
|
|
|
buyer_2_mortgage |
|
|
|
|
buyer_2_mortgage_value_check |
|
|
|
|
housing_benefits |
|
|
|
|
savings |
|
|
|
|
savings_value_check |
|
|
|
|
savings_deposit_value_check |
|
|
|
|
previous_ownership |
|
|
|
|
previous_shared |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
describe "pages" do |
|
|
|
|
let(:section) { instance_double(Form::Sales::Sections::Household, form: instance_double(Form, start_date:)) } |
|
|
|
|
|
|
|
|
|
context "when 2022" do |
|
|
|
|
let(:start_date) { Time.utc(2022, 2, 8) } |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
|
expect(subsection.pages.compact.map(&:id)).to eq( |
|
|
|
|
%w[ |
|
|
|
|
buyer_1_income |
|
|
|
|
buyer_1_income_value_check |
|
|
|
|
buyer_1_income_mortgage_value_check |
|
|
|
|
buyer_1_mortgage |
|
|
|
|
buyer_1_mortgage_value_check |
|
|
|
|
buyer_2_income |
|
|
|
|
buyer_2_income_mortgage_value_check |
|
|
|
|
buyer_2_mortgage |
|
|
|
|
buyer_2_mortgage_value_check |
|
|
|
|
housing_benefits |
|
|
|
|
savings |
|
|
|
|
savings_value_check |
|
|
|
|
savings_deposit_value_check |
|
|
|
|
previous_ownership |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when 2023" do |
|
|
|
|
let(:start_date) { Time.utc(2023, 2, 8) } |
|
|
|
|
|
|
|
|
|
it "has correct pages" do |
|
|
|
|
expect(subsection.pages.map(&:id)).to eq( |
|
|
|
|
%w[ |
|
|
|
|
buyer_1_income |
|
|
|
|
buyer_1_income_value_check |
|
|
|
|
buyer_1_income_mortgage_value_check |
|
|
|
|
buyer_1_mortgage |
|
|
|
|
buyer_1_mortgage_value_check |
|
|
|
|
buyer_2_income |
|
|
|
|
buyer_2_income_mortgage_value_check |
|
|
|
|
buyer_2_mortgage |
|
|
|
|
buyer_2_mortgage_value_check |
|
|
|
|
housing_benefits |
|
|
|
|
savings |
|
|
|
|
savings_value_check |
|
|
|
|
savings_deposit_value_check |
|
|
|
|
previous_ownership |
|
|
|
|
previous_shared |
|
|
|
|
], |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has the correct id" do |
|
|
|
|
|