From 731dcc9325067b22116dcff4d9611f119e398df7 Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Tue, 15 Oct 2024 11:27:26 +0100 Subject: [PATCH] CLDC-3650: Move copy for sales setup section to translation files (#2672) --- app/models/form/page.rb | 10 +- app/models/form/question.rb | 30 ++++- .../form/sales/pages/buyer_interview.rb | 1 + .../sales/pages/discounted_ownership_type.rb | 6 +- .../sales/pages/outright_ownership_type.rb | 6 +- app/models/form/sales/pages/privacy_notice.rb | 2 +- .../form/sales/pages/shared_ownership_type.rb | 6 +- .../form/sales/questions/buyer_company.rb | 2 - .../form/sales/questions/buyer_interview.rb | 4 +- app/models/form/sales/questions/buyer_live.rb | 2 - .../form/sales/questions/created_by_id.rb | 2 - .../questions/discounted_ownership_type.rb | 3 +- .../form/sales/questions/joint_purchase.rb | 8 -- .../sales/questions/managing_organisation.rb | 2 - .../sales/questions/number_joint_buyers.rb | 10 -- .../sales/questions/other_ownership_type.rb | 3 +- .../questions/outright_ownership_type.rb | 3 +- .../form/sales/questions/ownership_scheme.rb | 2 - .../sales/questions/owning_organisation_id.rb | 2 - .../form/sales/questions/privacy_notice.rb | 3 +- .../form/sales/questions/purchaser_code.rb | 3 - app/models/form/sales/questions/sale_date.rb | 2 - .../sales/questions/shared_ownership_type.rb | 11 +- app/views/form/_date_question.html.erb | 2 +- config/locales/forms/2023/sales/setup.en.yml | 110 ++++++++++++++++++ config/locales/forms/2024/sales/setup.en.yml | 110 ++++++++++++++++++ .../lettings/pages/address_fallback_spec.rb | 4 - .../lettings/pages/address_matcher_spec.rb | 4 - .../form/lettings/pages/address_spec.rb | 4 - .../care_home_charges_value_check_spec.rb | 4 - .../form/lettings/pages/created_by_spec.rb | 4 - ...t_household_person_age_value_check_spec.rb | 4 - ...gnant_household_person_value_check_spec.rb | 4 - ...ime_property_let_as_social_housing_spec.rb | 4 - ...ead_tenant_ethnic_background_white_spec.rb | 4 - .../form/lettings/pages/location_spec.rb | 4 - .../pages/managing_organisation_spec.rb | 4 - .../pages/max_rent_value_check_spec.rb | 4 - .../pages/min_rent_value_check_spec.rb | 4 - .../multiple_partners_value_check_spec.rb | 4 - .../form/lettings/pages/needs_type_spec.rb | 4 - .../pages/net_income_value_check_spec.rb | 4 - .../lettings/pages/no_address_found_spec.rb | 4 - ...t_household_person_age_value_check_spec.rb | 4 - ...gnant_household_person_value_check_spec.rb | 4 - .../pages/partner_under16_value_check_spec.rb | 4 - .../form/lettings/pages/person_age_spec.rb | 4 - .../pages/person_gender_identity_spec.rb | 4 - .../form/lettings/pages/person_known_spec.rb | 4 - ...person_over_retirement_value_check_spec.rb | 4 - .../pages/person_relationship_to_lead_spec.rb | 4 - ...erson_under_retirement_value_check_spec.rb | 4 - .../pages/person_working_situation_spec.rb | 4 - ...previous_housing_situation_renewal_spec.rb | 4 - .../pages/previous_housing_situation_spec.rb | 4 - .../pages/previous_local_authority_spec.rb | 4 - .../lettings/pages/previous_postcode_spec.rb | 4 - .../pages/property_local_authority_spec.rb | 4 - .../property_number_of_times_relet_spec.rb | 4 - .../lettings/pages/property_reference_spec.rb | 4 - .../property_wheelchair_accessible_spec.rb | 4 - .../form/lettings/pages/renewal_spec.rb | 4 - .../form/lettings/pages/rent_type_spec.rb | 4 - .../models/form/lettings/pages/scheme_spec.rb | 4 - .../pages/sheltered_accommodation_spec.rb | 4 - .../pages/starter_tenancy_type_spec.rb | 4 - .../form/lettings/pages/stock_owner_spec.rb | 4 - .../pages/tenancy_length_periodic_spec.rb | 4 - .../lettings/pages/tenancy_length_spec.rb | 4 - .../lettings/pages/tenancy_start_date_spec.rb | 4 - .../form/lettings/pages/tenancy_type_spec.rb | 4 - .../form/lettings/pages/tenant_code_spec.rb | 4 - .../lettings/pages/uprn_confirmation_spec.rb | 4 - .../lettings/pages/uprn_selection_spec.rb | 4 - spec/models/form/lettings/pages/uprn_spec.rb | 4 - .../form/lettings/pages/void_date_spec.rb | 4 - .../address_line1_for_address_matcher_spec.rb | 12 -- .../lettings/questions/address_line1_spec.rb | 12 -- .../lettings/questions/address_line2_spec.rb | 12 -- .../lettings/questions/age1_known_spec.rb | 24 ---- .../form/lettings/questions/age_known_spec.rb | 16 --- .../form/lettings/questions/age_spec.rb | 26 ----- .../form/lettings/questions/beds_spec.rb | 22 ---- .../care_home_charges_value_check_spec.rb | 12 -- .../form/lettings/questions/county_spec.rb | 12 -- .../lettings/questions/created_by_id_spec.rb | 12 -- .../lettings/questions/declaration_spec.rb | 12 -- .../lettings/questions/details_known_spec.rb | 20 ---- .../lettings/questions/ethnic_white_spec.rb | 16 --- .../questions/gender_identity1_spec.rb | 28 ----- .../models/form/lettings/questions/hb_spec.rb | 24 ---- .../form/lettings/questions/homeless_spec.rb | 8 -- .../questions/housingneeds_other_spec.rb | 8 -- .../questions/irproduct_other_spec.rb | 8 -- .../lettings/questions/is_carehome_spec.rb | 8 -- .../form/lettings/questions/joint_spec.rb | 22 ---- .../form/lettings/questions/layear_spec.rb | 8 -- .../questions/letting_allocation_spec.rb | 8 -- .../lettings/questions/location_id_spec.rb | 18 --- .../questions/managing_organisation_spec.rb | 12 -- .../questions/max_rent_value_check_spec.rb | 12 -- .../questions/min_rent_value_check_spec.rb | 12 -- .../multiple_partners_value_check_spec.rb | 12 -- .../questions/nationality_all_group_spec.rb | 12 -- .../questions/nationality_all_spec.rb | 12 -- .../lettings/questions/nationality_spec.rb | 12 -- .../lettings/questions/needs_type_spec.rb | 8 -- .../questions/no_address_found_spec.rb | 12 -- .../form/lettings/questions/offered_spec.rb | 12 -- .../partner_under16_value_check_spec.rb | 12 -- .../form/lettings/questions/period_spec.rb | 4 - .../questions/person_gender_identity_spec.rb | 36 ------ .../questions/person_relationship_spec.rb | 20 ---- .../person_working_situation_spec.rb | 20 ---- .../postcode_for_address_matcher_spec.rb | 12 -- .../postcode_for_full_address_spec.rb | 12 -- .../form/lettings/questions/ppcodenk_spec.rb | 24 ---- .../questions/previous_la_known_spec.rb | 24 ---- .../questions/previous_let_type_spec.rb | 16 --- .../questions/previous_tenure_renewal_spec.rb | 13 --- .../questions/previous_tenure_spec.rb | 12 -- .../questions/property_reference_spec.rb | 12 -- .../lettings/questions/reason_renewal_spec.rb | 12 -- .../form/lettings/questions/reason_spec.rb | 16 --- .../lettings/questions/reasonpref_spec.rb | 24 ---- .../lettings/questions/referral_prp_spec.rb | 12 -- .../form/lettings/questions/referral_spec.rb | 12 -- .../referral_supported_housing_prp_spec.rb | 12 -- .../referral_supported_housing_spec.rb | 12 -- .../form/lettings/questions/renewal_spec.rb | 26 ----- .../form/lettings/questions/rent_type_spec.rb | 12 -- .../form/lettings/questions/rsnvac_spec.rb | 8 -- .../form/lettings/questions/scheme_id_spec.rb | 29 ----- .../form/lettings/questions/sheltered_spec.rb | 12 -- .../questions/starter_tenancy_type_spec.rb | 24 ---- .../lettings/questions/startertenancy_spec.rb | 37 ------ .../lettings/questions/stock_owner_spec.rb | 12 -- .../tenancy_length_affordable_rent_spec.rb | 22 ---- .../tenancy_length_intermediate_rent_spec.rb | 22 ---- .../questions/tenancy_length_periodic_spec.rb | 12 -- .../lettings/questions/tenancy_length_spec.rb | 12 -- .../lettings/questions/tenancy_other_spec.rb | 12 -- .../questions/tenancy_start_date_spec.rb | 8 -- .../lettings/questions/tenancy_type_spec.rb | 12 -- .../lettings/questions/tenant_code_spec.rb | 12 -- .../lettings/questions/town_or_city_spec.rb | 12 -- .../questions/uprn_confirmation_spec.rb | 12 -- .../lettings/questions/uprn_known_spec.rb | 16 --- .../lettings/questions/uprn_selection_spec.rb | 12 -- .../form/lettings/questions/uprn_spec.rb | 12 -- .../form/lettings/questions/voiddate_spec.rb | 8 -- .../form/lettings/questions/waityear_spec.rb | 16 --- .../lettings/questions/wheelchair_spec.rb | 22 ---- spec/models/form/page_spec.rb | 37 +++++- spec/models/form/question_spec.rb | 65 ++++++++++- .../pages/about_price_value_check_spec.rb | 4 - .../form/sales/pages/about_staircase_spec.rb | 4 - .../form/sales/pages/address_fallback_spec.rb | 4 - .../form/sales/pages/address_matcher_spec.rb | 4 - spec/models/form/sales/pages/address_spec.rb | 4 - spec/models/form/sales/pages/age1_spec.rb | 4 - spec/models/form/sales/pages/age2_spec.rb | 4 - .../form/sales/pages/armed_forces_spec.rb | 4 - .../sales/pages/armed_forces_spouse_spec.rb | 4 - .../buyer1_ethnic_background_arab_spec.rb | 4 - .../buyer1_ethnic_background_asian_spec.rb | 4 - .../buyer1_ethnic_background_black_spec.rb | 4 - .../buyer1_ethnic_background_mixed_spec.rb | 4 - .../buyer1_ethnic_background_white_spec.rb | 4 - .../sales/pages/buyer1_ethnic_group_spec.rb | 4 - .../buyer1_income_max_value_check_spec.rb | 4 - .../buyer1_income_min_value_check_spec.rb | 4 - .../form/sales/pages/buyer1_income_spec.rb | 4 - .../pages/buyer1_live_in_property_spec.rb | 4 - .../form/sales/pages/buyer1_mortgage_spec.rb | 4 - .../sales/pages/buyer1_nationality_spec.rb | 4 - .../pages/buyer1_previous_tenure_spec.rb | 4 - .../pages/buyer1_working_situation_spec.rb | 4 - .../buyer2_ethnic_background_arab_spec.rb | 4 - .../buyer2_ethnic_background_asian_spec.rb | 4 - .../buyer2_ethnic_background_black_spec.rb | 4 - .../buyer2_ethnic_background_mixed_spec.rb | 4 - .../buyer2_ethnic_background_white_spec.rb | 4 - .../sales/pages/buyer2_ethnic_group_spec.rb | 4 - .../buyer2_income_max_value_check_spec.rb | 4 - .../buyer2_income_min_value_check_spec.rb | 4 - .../form/sales/pages/buyer2_income_spec.rb | 4 - .../pages/buyer2_live_in_property_spec.rb | 4 - .../form/sales/pages/buyer2_living_in_spec.rb | 4 - .../form/sales/pages/buyer2_mortgage_spec.rb | 4 - .../sales/pages/buyer2_nationality_spec.rb | 4 - .../buyer2_previous_housing_situation_spec.rb | 4 - .../buyer2_relationship_to_buyer1_spec.rb | 4 - .../pages/buyer2_working_situation_spec.rb | 4 - .../form/sales/pages/buyer_company_spec.rb | 4 - .../form/sales/pages/buyer_interview_spec.rb | 20 +++- .../pages/buyer_live_in_value_check_spec.rb | 4 - .../form/sales/pages/buyer_live_spec.rb | 10 +- .../form/sales/pages/buyer_previous_spec.rb | 4 - .../sales/pages/buyer_still_serving_spec.rb | 4 - .../sales/pages/buyers_organisations_spec.rb | 4 - .../combined_income_max_value_check_spec.rb | 4 - .../form/sales/pages/created_by_spec.rb | 6 +- .../form/sales/pages/deposit_discount_spec.rb | 4 - spec/models/form/sales/pages/deposit_spec.rb | 4 - .../sales/pages/deposit_value_check_spec.rb | 4 - spec/models/form/sales/pages/discount_spec.rb | 4 - .../pages/discounted_ownership_type_spec.rb | 18 --- .../pages/discounted_sale_value_check_spec.rb | 4 - spec/models/form/sales/pages/equity_spec.rb | 4 - .../form/sales/pages/exchange_date_spec.rb | 4 - .../form/sales/pages/extra_borrowing_spec.rb | 4 - .../form/sales/pages/gender_identity1_spec.rb | 4 - .../form/sales/pages/gender_identity2_spec.rb | 4 - spec/models/form/sales/pages/grant_spec.rb | 4 - .../sales/pages/handover_date_check_spec.rb | 4 - .../form/sales/pages/handover_date_spec.rb | 4 - .../sales/pages/household_disability_spec.rb | 4 - .../pages/household_wheelchair_check_spec.rb | 4 - .../sales/pages/household_wheelchair_spec.rb | 4 - .../form/sales/pages/housing_benefits_spec.rb | 4 - .../form/sales/pages/joint_purchase_spec.rb | 4 - .../form/sales/pages/la_nominations_spec.rb | 4 - .../sales/pages/last_accommodation_la_spec.rb | 4 - .../sales/pages/last_accommodation_spec.rb | 4 - .../sales/pages/leasehold_charges_spec.rb | 4 - .../pages/living_before_purchase_spec.rb | 4 - .../sales/pages/managing_organisation_spec.rb | 4 - .../pages/monthly_charges_value_check_spec.rb | 4 - .../form/sales/pages/monthly_rent_spec.rb | 4 - .../form/sales/pages/mortgage_amount_spec.rb | 4 - .../sales/pages/mortgage_lender_other_spec.rb | 4 - .../form/sales/pages/mortgage_lender_spec.rb | 4 - .../form/sales/pages/mortgage_length_spec.rb | 4 - .../sales/pages/mortgage_value_check_spec.rb | 4 - .../multiple_partners_value_check_spec.rb | 4 - .../form/sales/pages/no_address_found_spec.rb | 4 - .../sales/pages/number_joint_buyers_spec.rb | 4 - .../number_of_others_in_property_spec.rb | 4 - ...rsons_shared_ownership_value_check_spec.rb | 4 - .../pages/outright_ownership_type_spec.rb | 18 --- .../form/sales/pages/ownership_scheme_spec.rb | 4 - .../sales/pages/owning_organisation_spec.rb | 4 - .../pages/partner_under16_value_check_spec.rb | 4 - .../percentage_discount_value_check_spec.rb | 4 - .../form/sales/pages/person_age_spec.rb | 4 - .../pages/person_gender_identity_spec.rb | 4 - .../form/sales/pages/person_known_spec.rb | 4 - .../person_relationship_to_buyer1_spec.rb | 4 - ...rson_student_not_child_value_check_spec.rb | 4 - .../pages/person_working_situation_spec.rb | 4 - spec/models/form/sales/pages/postcode_spec.rb | 4 - .../sales/pages/previous_bedrooms_spec.rb | 4 - .../sales/pages/previous_ownership_spec.rb | 4 - .../pages/previous_property_type_spec.rb | 4 - .../form/sales/pages/previous_shared_spec.rb | 4 - .../form/sales/pages/previous_tenure_spec.rb | 4 - .../form/sales/pages/privacy_notice_spec.rb | 26 +++-- .../pages/property_building_type_spec.rb | 4 - .../pages/property_local_authority_spec.rb | 4 - .../pages/property_number_of_bedrooms_spec.rb | 4 - .../sales/pages/property_unit_type_spec.rb | 4 - .../property_wheelchair_accessible_spec.rb | 4 - .../purchase_price_outright_ownership_spec.rb | 4 - .../form/sales/pages/purchase_price_spec.rb | 4 - .../form/sales/pages/purchaser_code_spec.rb | 4 - spec/models/form/sales/pages/resale_spec.rb | 4 - .../pages/retirement_value_check_spec.rb | 4 - .../form/sales/pages/sale_date_check_spec.rb | 4 - .../models/form/sales/pages/sale_date_spec.rb | 4 - spec/models/form/sales/pages/savings_spec.rb | 4 - .../sales/pages/savings_value_check_spec.rb | 4 - ...ared_ownership_deposit_value_check_spec.rb | 4 - .../sales/pages/shared_ownership_type_spec.rb | 23 +--- .../pages/staircase_owned_value_check_spec.rb | 4 - .../models/form/sales/pages/staircase_spec.rb | 4 - .../sales/pages/uprn_confirmation_spec.rb | 4 - .../form/sales/pages/uprn_selection_spec.rb | 4 - spec/models/form/sales/pages/uprn_spec.rb | 4 - .../pages/value_shared_ownership_spec.rb | 4 - .../address_line1_for_address_matcher_spec.rb | 12 -- .../sales/questions/address_line1_spec.rb | 12 -- .../sales/questions/address_line2_spec.rb | 14 +-- spec/models/form/sales/questions/age1_spec.rb | 12 -- spec/models/form/sales/questions/age2_spec.rb | 12 -- .../form/sales/questions/armed_forces_spec.rb | 12 -- .../questions/armed_forces_spouse_spec.rb | 12 -- .../sales/questions/buyer1_age_known_spec.rb | 12 -- .../buyer1_ethnic_background_arab_spec.rb | 12 -- .../buyer1_ethnic_background_asian_spec.rb | 12 -- .../buyer1_ethnic_background_black_spec.rb | 12 -- .../buyer1_ethnic_background_mixed_spec.rb | 12 -- .../buyer1_ethnic_background_white_spec.rb | 16 --- .../questions/buyer1_ethnic_group_spec.rb | 12 -- .../questions/buyer1_income_known_spec.rb | 8 -- .../sales/questions/buyer1_income_spec.rb | 12 -- .../buyer1_income_value_check_spec.rb | 12 -- .../questions/buyer1_live_in_property_spec.rb | 12 -- .../sales/questions/buyer1_mortgage_spec.rb | 8 -- .../questions/buyer1_nationality_spec.rb | 12 -- .../questions/buyer1_previous_tenure_spec.rb | 8 -- .../buyer1_working_situation_spec.rb | 8 -- .../sales/questions/buyer2_age_known_spec.rb | 8 -- .../buyer2_ethnic_background_arab_spec.rb | 12 -- .../buyer2_ethnic_background_asian_spec.rb | 12 -- .../buyer2_ethnic_background_black_spec.rb | 12 -- .../buyer2_ethnic_background_mixed_spec.rb | 12 -- .../buyer2_ethnic_background_white_spec.rb | 12 -- .../questions/buyer2_ethnic_group_spec.rb | 12 -- .../questions/buyer2_income_known_spec.rb | 8 -- .../sales/questions/buyer2_income_spec.rb | 12 -- .../buyer2_income_value_check_spec.rb | 12 -- .../questions/buyer2_live_in_property_spec.rb | 12 -- .../sales/questions/buyer2_living_in_spec.rb | 12 -- .../sales/questions/buyer2_mortgage_spec.rb | 8 -- .../questions/buyer2_nationality_spec.rb | 12 -- .../buyer2_relationship_to_buyer1_spec.rb | 12 -- .../buyer2_working_situation_spec.rb | 12 -- .../sales/questions/buyer_company_spec.rb | 8 -- .../sales/questions/buyer_interview_spec.rb | 28 ++--- .../buyer_live_in_value_check_spec.rb | 12 -- .../form/sales/questions/buyer_live_spec.rb | 26 +---- .../sales/questions/buyer_previous_spec.rb | 26 ----- .../questions/buyer_still_serving_spec.rb | 12 -- .../questions/buyers_organisations_spec.rb | 12 -- .../combined_income_value_check_spec.rb | 12 -- .../form/sales/questions/county_spec.rb | 12 -- .../sales/questions/created_by_id_spec.rb | 12 -- .../sales/questions/deposit_amount_spec.rb | 18 --- .../sales/questions/deposit_discount_spec.rb | 12 -- .../questions/deposit_value_check_spec.rb | 12 -- .../form/sales/questions/discount_spec.rb | 14 --- .../discounted_ownership_type_spec.rb | 8 -- .../discounted_sale_value_check_spec.rb | 12 -- .../form/sales/questions/equity_spec.rb | 12 -- .../sales/questions/exchange_date_spec.rb | 8 -- .../sales/questions/extra_borrowing_spec.rb | 12 -- .../form/sales/questions/fromprop_spec.rb | 12 -- .../sales/questions/gender_identity1_spec.rb | 28 ----- .../sales/questions/gender_identity2_spec.rb | 28 ----- .../models/form/sales/questions/grant_spec.rb | 12 -- .../questions/handover_date_check_spec.rb | 12 -- .../sales/questions/handover_date_spec.rb | 8 -- .../questions/has_leasehold_charges_spec.rb | 12 -- .../questions/household_disability_spec.rb | 12 -- .../household_wheelchair_check_spec.rb | 12 -- .../questions/household_wheelchair_spec.rb | 12 -- .../sales/questions/housing_benefits_spec.rb | 22 ---- .../sales/questions/joint_purchase_spec.rb | 28 ----- .../sales/questions/la_nominations_spec.rb | 12 -- .../sales/questions/leasehold_charges_spec.rb | 12 -- .../questions/living_before_purchase_spec.rb | 12 -- .../living_before_purchase_years_spec.rb | 24 ---- .../questions/managing_organisation_spec.rb | 12 -- .../monthly_charges_value_check_spec.rb | 12 -- .../form/sales/questions/monthly_rent_spec.rb | 12 -- .../sales/questions/mortgage_amount_spec.rb | 12 -- .../questions/mortgage_lender_other_spec.rb | 12 -- .../sales/questions/mortgage_lender_spec.rb | 8 -- .../sales/questions/mortgage_length_spec.rb | 14 --- .../questions/mortgage_value_check_spec.rb | 12 -- .../multiple_partners_value_check_spec.rb | 12 -- .../questions/nationality_all_group_spec.rb | 24 ---- .../sales/questions/nationality_all_spec.rb | 16 --- .../sales/questions/no_address_found_spec.rb | 12 -- .../questions/number_joint_buyers_spec.rb | 22 ---- .../number_of_others_in_property_spec.rb | 24 ---- ...rsons_shared_ownership_value_check_spec.rb | 12 -- .../questions/other_ownership_type_spec.rb | 8 -- .../questions/outright_ownership_type_spec.rb | 8 -- .../sales/questions/ownership_scheme_spec.rb | 8 -- .../questions/owning_organisation_id_spec.rb | 12 -- .../partner_under16_value_check_spec.rb | 12 -- .../percentage_discount_value_check_spec.rb | 12 -- .../sales/questions/person_age_known_spec.rb | 36 ------ .../form/sales/questions/person_age_spec.rb | 24 ---- .../questions/person_gender_identity_spec.rb | 52 --------- .../form/sales/questions/person_known_spec.rb | 36 ------ .../person_relationship_to_buyer1_spec.rb | 32 ----- ...rson_student_not_child_value_check_spec.rb | 12 -- .../person_working_situation_spec.rb | 32 ----- .../postcode_for_address_matcher_spec.rb | 12 -- .../postcode_for_full_address_spec.rb | 12 -- .../sales/questions/postcode_known_spec.rb | 12 -- .../form/sales/questions/postcode_spec.rb | 12 -- .../sales/questions/previous_bedrooms_spec.rb | 12 -- .../sales/questions/previous_la_known_spec.rb | 12 -- .../questions/previous_postcode_known_spec.rb | 12 -- .../sales/questions/previous_postcode_spec.rb | 12 -- .../questions/previous_tenure_buyer2_spec.rb | 12 -- .../sales/questions/previous_tenure_spec.rb | 12 -- .../form/sales/questions/prevloc_spec.rb | 8 -- .../form/sales/questions/prevown_spec.rb | 26 ----- .../form/sales/questions/prevshared_spec.rb | 12 -- .../sales/questions/privacy_notice_spec.rb | 24 ++-- .../questions/property_building_type_spec.rb | 12 -- .../property_local_authority_spec.rb | 8 -- .../property_number_of_bedrooms_spec.rb | 12 -- .../questions/property_unit_type_spec.rb | 8 -- .../property_wheelchair_accessible_spec.rb | 18 --- .../sales/questions/purchase_price_spec.rb | 24 ---- .../sales/questions/purchaser_code_spec.rb | 12 -- .../form/sales/questions/resale_spec.rb | 12 -- .../questions/retirement_value_check_spec.rb | 12 -- .../sales/questions/sale_date_check_spec.rb | 12 -- .../form/sales/questions/sale_date_spec.rb | 8 -- .../form/sales/questions/savings_nk_spec.rb | 12 -- .../form/sales/questions/savings_spec.rb | 12 -- .../questions/savings_value_check_spec.rb | 12 -- ...ared_ownership_deposit_value_check_spec.rb | 16 --- .../questions/shared_ownership_type_spec.rb | 46 ++------ .../sales/questions/staircase_bought_spec.rb | 12 -- .../sales/questions/staircase_owned_spec.rb | 26 ----- .../staircase_owned_value_check_spec.rb | 12 -- .../sales/questions/staircase_sale_spec.rb | 12 -- .../form/sales/questions/staircase_spec.rb | 12 -- .../form/sales/questions/town_or_city_spec.rb | 12 -- .../sales/questions/uprn_confirmation_spec.rb | 12 -- .../form/sales/questions/uprn_known_spec.rb | 16 --- .../sales/questions/uprn_selection_spec.rb | 12 -- spec/models/form/sales/questions/uprn_spec.rb | 12 -- .../models/form/sales/questions/value_spec.rb | 12 -- 422 files changed, 440 insertions(+), 3999 deletions(-) create mode 100644 config/locales/forms/2023/sales/setup.en.yml create mode 100644 config/locales/forms/2024/sales/setup.en.yml delete mode 100644 spec/models/form/lettings/questions/startertenancy_spec.rb diff --git a/app/models/form/page.rb b/app/models/form/page.rb index f1d6497a0..7a5c4bf87 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -1,5 +1,5 @@ class Form::Page - attr_accessor :id, :header, :header_partial, :description, :questions, :depends_on, :title_text, + attr_accessor :id, :header_partial, :description, :questions, :depends_on, :title_text, :informative_text, :subsection, :hide_subsection_label, :next_unresolved_page_id, :skip_text, :interruption_screen_question_ids, :submit_text @@ -24,6 +24,14 @@ class Form::Page delegate :form, to: :subsection + def copy_key + @copy_key ||= "#{form.type}.#{subsection.id}.#{questions[0].id}" + end + + def header + @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.page_header", default: "") + end + def routed_to?(log, _current_user) return true unless depends_on || subsection.depends_on diff --git a/app/models/form/question.rb b/app/models/form/question.rb index d5d2b7f36..9409350f6 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -1,9 +1,9 @@ class Form::Question include FormattingHelper - attr_accessor :id, :header, :hint_text, :description, :questions, :disable_clearing_if_not_routed_or_dynamic_answer_options, + attr_accessor :id, :description, :questions, :disable_clearing_if_not_routed_or_dynamic_answer_options, :type, :min, :max, :step, :width, :fields_to_add, :result_field, - :conditional_for, :readonly, :answer_options, :page, :check_answer_label, + :conditional_for, :readonly, :answer_options, :page, :inferred_answers, :hidden_in_check_answers, :inferred_check_answers_value, :top_guidance_partial, :bottom_guidance_partial, :prefix, :suffix, :requires_js, :fields_added, :derived, :check_answers_card_number, @@ -50,6 +50,22 @@ class Form::Question delegate :subsection, to: :page delegate :form, to: :subsection + def copy_key + @copy_key ||= "#{form.type}.#{subsection.id}.#{id}" + end + + def check_answer_label + @check_answer_label ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.check_answer_label", default: "") + end + + def header + @header ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.question_text", default: "") + end + + def hint_text + @hint_text ||= I18n.t("forms.#{form.start_date.year}.#{copy_key}.hint_text", default: "") + end + def answer_label(log, user = nil) return checkbox_answer_label(log) if type == "checkbox" return log[id]&.to_formatted_s(:govuk_date).to_s if type == "date" @@ -206,7 +222,15 @@ class Form::Question end def error_display_label - label = error_label || check_answer_label || header || id.humanize + label = if error_label.present? + error_label + elsif check_answer_label.present? + check_answer_label + elsif header.present? + header + else + id.humanize + end format_ending(label) end diff --git a/app/models/form/sales/pages/buyer_interview.rb b/app/models/form/sales/pages/buyer_interview.rb index f9c4e3bbc..d042db288 100644 --- a/app/models/form/sales/pages/buyer_interview.rb +++ b/app/models/form/sales/pages/buyer_interview.rb @@ -2,6 +2,7 @@ class Form::Sales::Pages::BuyerInterview < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) @joint_purchase = joint_purchase + @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" end def questions diff --git a/app/models/form/sales/pages/discounted_ownership_type.rb b/app/models/form/sales/pages/discounted_ownership_type.rb index 3fe2011ef..5998e6019 100644 --- a/app/models/form/sales/pages/discounted_ownership_type.rb +++ b/app/models/form/sales/pages/discounted_ownership_type.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "discounted_ownership_type" - @header = header + @copy_key = "sales.setup.type.discounted_ownership" @depends_on = [{ "ownershipsch" => 2, }] @@ -13,8 +13,4 @@ class Form::Sales::Pages::DiscountedOwnershipType < ::Form::Page Form::Sales::Questions::DiscountedOwnershipType.new(nil, nil, self), ] end - - def header - "Type of discounted ownership sale" if form.start_date.year >= 2023 - end end diff --git a/app/models/form/sales/pages/outright_ownership_type.rb b/app/models/form/sales/pages/outright_ownership_type.rb index 099b45d07..35194102a 100644 --- a/app/models/form/sales/pages/outright_ownership_type.rb +++ b/app/models/form/sales/pages/outright_ownership_type.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "outright_ownership_type" - @header = header + @copy_key = "sales.setup.type.outright_ownership" @depends_on = [{ "ownershipsch" => 3, }] @@ -14,8 +14,4 @@ class Form::Sales::Pages::OutrightOwnershipType < ::Form::Page Form::Sales::Questions::OtherOwnershipType.new(nil, nil, self), ] end - - def header - "Type of outright sale" if form.start_date.year >= 2023 - end end diff --git a/app/models/form/sales/pages/privacy_notice.rb b/app/models/form/sales/pages/privacy_notice.rb index 1bd9e22de..cf6a7bbbc 100644 --- a/app/models/form/sales/pages/privacy_notice.rb +++ b/app/models/form/sales/pages/privacy_notice.rb @@ -1,7 +1,7 @@ class Form::Sales::Pages::PrivacyNotice < ::Form::Page def initialize(id, hsh, subsection, joint_purchase:) super(id, hsh, subsection) - @header = "Ministry of Housing, Communities and Local Government privacy notice" + @copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @joint_purchase = joint_purchase end diff --git a/app/models/form/sales/pages/shared_ownership_type.rb b/app/models/form/sales/pages/shared_ownership_type.rb index 3e65cb628..a156abb17 100644 --- a/app/models/form/sales/pages/shared_ownership_type.rb +++ b/app/models/form/sales/pages/shared_ownership_type.rb @@ -2,7 +2,7 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page def initialize(id, hsh, subsection) super @id = "shared_ownership_type" - @header = header + @copy_key = "sales.setup.type.shared_ownership" @depends_on = [{ "ownershipsch" => 1, }] @@ -13,8 +13,4 @@ class Form::Sales::Pages::SharedOwnershipType < ::Form::Page Form::Sales::Questions::SharedOwnershipType.new(nil, nil, self), ] end - - def header - "Type of shared ownership sale" if form.start_date.year >= 2023 - end end diff --git a/app/models/form/sales/questions/buyer_company.rb b/app/models/form/sales/questions/buyer_company.rb index 40763c818..a5dc69d8d 100644 --- a/app/models/form/sales/questions/buyer_company.rb +++ b/app/models/form/sales/questions/buyer_company.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::BuyerCompany < ::Form::Question def initialize(id, hsh, page) super @id = "companybuy" - @check_answer_label = "Company buyer" - @header = "Is the buyer a company?" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/buyer_interview.rb b/app/models/form/sales/questions/buyer_interview.rb index 4e7946151..8b434d11c 100644 --- a/app/models/form/sales/questions/buyer_interview.rb +++ b/app/models/form/sales/questions/buyer_interview.rb @@ -2,10 +2,8 @@ class Form::Sales::Questions::BuyerInterview < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "noint" - @check_answer_label = "#{joint_purchase ? 'Buyers' : 'Buyer'} interviewed in person?" - @header = "#{joint_purchase ? 'Were the buyers' : 'Was the buyer'} interviewed for any of the answers you will provide on this log?" + @copy_key = "sales.setup.noint.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "radio" - @hint_text = "You should still try to answer all questions even if the #{joint_purchase ? 'buyers weren’t' : 'buyer wasn’t'} interviewed in person" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/buyer_live.rb b/app/models/form/sales/questions/buyer_live.rb index 77153de0b..315329088 100644 --- a/app/models/form/sales/questions/buyer_live.rb +++ b/app/models/form/sales/questions/buyer_live.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::BuyerLive < ::Form::Question def initialize(id, hsh, page) super @id = "buylivein" - @check_answer_label = "Buyers living in property" - @header = form.start_year_after_2024? ? "Will any buyers live in the property?" : "Will the buyers live in the property?" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/created_by_id.rb b/app/models/form/sales/questions/created_by_id.rb index 15a10e893..516afd2bc 100644 --- a/app/models/form/sales/questions/created_by_id.rb +++ b/app/models/form/sales/questions/created_by_id.rb @@ -4,8 +4,6 @@ class Form::Sales::Questions::CreatedById < ::Form::Question def initialize(id, hsh, page) super @id = "assigned_to_id" - @check_answer_label = "Log owner" - @header = "Which user are you creating this log for?" @derived = true @type = "select" end diff --git a/app/models/form/sales/questions/discounted_ownership_type.rb b/app/models/form/sales/questions/discounted_ownership_type.rb index e4062d485..6108e4ef8 100644 --- a/app/models/form/sales/questions/discounted_ownership_type.rb +++ b/app/models/form/sales/questions/discounted_ownership_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::DiscountedOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of discounted ownership sale" - @header = "What is the type of discounted ownership sale?" + @copy_key = "sales.setup.type.discounted_ownership" @type = "radio" @top_guidance_partial = guidance_partial @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/sales/questions/joint_purchase.rb b/app/models/form/sales/questions/joint_purchase.rb index 27da46bc0..7e876a4cc 100644 --- a/app/models/form/sales/questions/joint_purchase.rb +++ b/app/models/form/sales/questions/joint_purchase.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question def initialize(id, hsh, page) super @id = "jointpur" - @check_answer_label = "Joint purchase" - @header = "Is this a joint purchase?" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @@ -14,11 +12,5 @@ class Form::Sales::Questions::JointPurchase < ::Form::Question "2" => { "value" => "No" }, }.freeze - def hint_text - if form.start_year_after_2024? - "This is where two or more people are named as legal owners of the property after the purchase" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 9, 2024 => 11 }.freeze end diff --git a/app/models/form/sales/questions/managing_organisation.rb b/app/models/form/sales/questions/managing_organisation.rb index 03609233e..17884687f 100644 --- a/app/models/form/sales/questions/managing_organisation.rb +++ b/app/models/form/sales/questions/managing_organisation.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::ManagingOrganisation < ::Form::Question def initialize(id, hsh, page) super @id = "managing_organisation_id" - @check_answer_label = "Reported by" - @header = "Which organisation is reporting this sale?" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/number_joint_buyers.rb b/app/models/form/sales/questions/number_joint_buyers.rb index 95117bb44..d86e37a93 100644 --- a/app/models/form/sales/questions/number_joint_buyers.rb +++ b/app/models/form/sales/questions/number_joint_buyers.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question def initialize(id, hsh, page) super @id = "jointmore" - @check_answer_label = "More than 2 joint buyers" - @header = "Are there more than 2 joint buyers of this property?" @type = "radio" @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @@ -15,13 +13,5 @@ class Form::Sales::Questions::NumberJointBuyers < ::Form::Question "3" => { "value" => "Don’t know" }, }.freeze - def hint_text - if form.start_year_after_2024? - nil - else - "You should still try to answer all questions even if the buyers weren’t interviewed in person" - end - end - QUESTION_NUMBER_FROM_YEAR = { 2023 => 10, 2024 => 12 }.freeze end diff --git a/app/models/form/sales/questions/other_ownership_type.rb b/app/models/form/sales/questions/other_ownership_type.rb index a6e98d784..84742b7ea 100644 --- a/app/models/form/sales/questions/other_ownership_type.rb +++ b/app/models/form/sales/questions/other_ownership_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::OtherOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "othtype" - @check_answer_label = "Type of other sale" - @header = "What type of sale is it?" + @copy_key = "sales.setup.type.outright_ownership.othtype" @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/outright_ownership_type.rb b/app/models/form/sales/questions/outright_ownership_type.rb index 8831367b6..f56b63d78 100644 --- a/app/models/form/sales/questions/outright_ownership_type.rb +++ b/app/models/form/sales/questions/outright_ownership_type.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::OutrightOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of outright sale" - @header = "What is the type of outright sale?" + @copy_key = "sales.setup.type.outright_ownership.type" @type = "radio" @top_guidance_partial = guidance_partial @answer_options = ANSWER_OPTIONS diff --git a/app/models/form/sales/questions/ownership_scheme.rb b/app/models/form/sales/questions/ownership_scheme.rb index 9fabb49dc..6b33a2566 100644 --- a/app/models/form/sales/questions/ownership_scheme.rb +++ b/app/models/form/sales/questions/ownership_scheme.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::OwnershipScheme < ::Form::Question def initialize(id, hsh, page) super @id = "ownershipsch" - @check_answer_label = "Purchase made under ownership scheme" - @header = "Was this purchase made through an ownership scheme?" @type = "radio" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/owning_organisation_id.rb b/app/models/form/sales/questions/owning_organisation_id.rb index 669c43a0e..aacccecd3 100644 --- a/app/models/form/sales/questions/owning_organisation_id.rb +++ b/app/models/form/sales/questions/owning_organisation_id.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::OwningOrganisationId < ::Form::Question def initialize(id, hsh, page) super @id = "owning_organisation_id" - @check_answer_label = "Owning organisation" - @header = "Which organisation owns this log?" @derived = true @type = "select" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/privacy_notice.rb b/app/models/form/sales/questions/privacy_notice.rb index 6e53f36ff..a9e737f0e 100644 --- a/app/models/form/sales/questions/privacy_notice.rb +++ b/app/models/form/sales/questions/privacy_notice.rb @@ -2,8 +2,7 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question def initialize(id, hsh, page, joint_purchase:) super(id, hsh, page) @id = "privacynotice" - @check_answer_label = "#{joint_purchase ? 'Buyers have' : 'Buyer has'} seen the privacy notice?" - @header = "Declaration" + @copy_key = "sales.setup.privacynotice.#{joint_purchase ? 'joint_purchase' : 'not_joint_purchase'}" @type = "checkbox" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @joint_purchase = joint_purchase diff --git a/app/models/form/sales/questions/purchaser_code.rb b/app/models/form/sales/questions/purchaser_code.rb index 12ff7f1de..fd3b126e9 100644 --- a/app/models/form/sales/questions/purchaser_code.rb +++ b/app/models/form/sales/questions/purchaser_code.rb @@ -2,9 +2,6 @@ class Form::Sales::Questions::PurchaserCode < ::Form::Question def initialize(id, hsh, page) super @id = "purchid" - @check_answer_label = "Purchaser code" - @header = "What is the purchaser code?" - @hint_text = "This is how you usually refer to the purchaser on your own systems." @type = "text" @width = 10 @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] diff --git a/app/models/form/sales/questions/sale_date.rb b/app/models/form/sales/questions/sale_date.rb index ae02f1cfd..00f0c86dd 100644 --- a/app/models/form/sales/questions/sale_date.rb +++ b/app/models/form/sales/questions/sale_date.rb @@ -2,8 +2,6 @@ class Form::Sales::Questions::SaleDate < ::Form::Question def initialize(id, hsh, page) super @id = "saledate" - @check_answer_label = "Sale completion date" - @header = "What is the sale completion date?" @type = "date" @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/app/models/form/sales/questions/shared_ownership_type.rb b/app/models/form/sales/questions/shared_ownership_type.rb index 4c1879888..1ede14a4d 100644 --- a/app/models/form/sales/questions/shared_ownership_type.rb +++ b/app/models/form/sales/questions/shared_ownership_type.rb @@ -2,22 +2,13 @@ class Form::Sales::Questions::SharedOwnershipType < ::Form::Question def initialize(id, hsh, page) super @id = "type" - @check_answer_label = "Type of shared ownership sale" - @header = "What is the type of shared ownership sale?" + @copy_key = "sales.setup.type.shared_ownership" @top_guidance_partial = guidance_partial @type = "radio" @answer_options = answer_options @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end - def hint_text - if form.start_year_after_2024? - "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" - else - "A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion" - end - end - def answer_options if form.start_date.year >= 2023 { diff --git a/app/views/form/_date_question.html.erb b/app/views/form/_date_question.html.erb index 1be21d212..aded6f3b3 100644 --- a/app/views/form/_date_question.html.erb +++ b/app/views/form/_date_question.html.erb @@ -3,7 +3,7 @@ <%= f.govuk_date_field question.id.to_sym, caption: caption(caption_text, page_header, conditional), legend: legend(question, page_header, conditional), - hint: { text: (question.hint_text.nil? ? "" : (question.hint_text.html_safe + "

".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" }, + hint: { text: (question.hint_text.blank? ? "" : (question.hint_text.html_safe + "

".html_safe)) + "For example, #{date_mid_collection_year_formatted(@log.startdate)}" }, width: 20, **stimulus_html_attributes(question) do %> <%= govuk_inset_text(text: question.unresolved_hint_text) if question.unresolved_hint_text.present? && @log.unresolved %> diff --git a/config/locales/forms/2023/sales/setup.en.yml b/config/locales/forms/2023/sales/setup.en.yml new file mode 100644 index 000000000..05e53ce8b --- /dev/null +++ b/config/locales/forms/2023/sales/setup.en.yml @@ -0,0 +1,110 @@ +en: + forms: + 2023: + sales: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Owning organisation" + hint_text: "" + question_text: "Which organisation owns this log?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Reported by" + hint_text: "" + question_text: "Which organisation is reporting this sale?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + saledate: + page_header: "" + check_answer_label: "Sale completion date" + hint_text: "" + question_text: "What is the sale completion date?" + + purchid: + page_header: "" + check_answer_label: "Purchaser code" + hint_text: "This is how you usually refer to the purchaser on your own systems." + question_text: "What is the purchaser code?" + + ownershipsch: + page_header: "" + check_answer_label: "Purchase made under ownership scheme" + hint_text: "" + question_text: "Was this purchase made through an ownership scheme?" + + type: + shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "Type of shared ownership sale" + hint_text: "A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + 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: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will the buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" + question_text: "Are there more than 2 joint buyers of this property?" + + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn’t interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + + privacynotice: + joint_purchase: + page_header: "" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" diff --git a/config/locales/forms/2024/sales/setup.en.yml b/config/locales/forms/2024/sales/setup.en.yml new file mode 100644 index 000000000..e5fc49b82 --- /dev/null +++ b/config/locales/forms/2024/sales/setup.en.yml @@ -0,0 +1,110 @@ +en: + forms: + 2024: + sales: + setup: + owning_organisation_id: + page_header: "" + check_answer_label: "Owning organisation" + hint_text: "" + question_text: "Which organisation owns this log?" + + managing_organisation_id: + page_header: "" + check_answer_label: "Reported by" + hint_text: "" + question_text: "Which organisation is reporting this sale?" + + assigned_to_id: + page_header: "" + check_answer_label: "Log owner" + hint_text: "" + question_text: "Which user are you creating this log for?" + + saledate: + page_header: "" + check_answer_label: "Sale completion date" + hint_text: "" + question_text: "What is the sale completion date?" + + purchid: + page_header: "" + check_answer_label: "Purchaser code" + hint_text: "This is how you usually refer to the purchaser on your own systems." + question_text: "What is the purchaser code?" + + ownershipsch: + page_header: "" + check_answer_label: "Purchase made under ownership scheme" + hint_text: "" + question_text: "Was this purchase made through an ownership scheme?" + + type: + shared_ownership: + page_header: "Type of shared ownership sale" + check_answer_label: "Type of shared ownership sale" + hint_text: "When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction" + question_text: "What is the type of shared ownership sale?" + discounted_ownership: + page_header: "Type of discounted ownership sale" + 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: "" + check_answer_label: "Company buyer" + hint_text: "" + question_text: "Is the buyer a company?" + + buylivein: + page_header: "" + check_answer_label: "Buyers living in property" + hint_text: "" + question_text: "Will any buyers live in the property?" + + jointpur: + page_header: "" + check_answer_label: "Joint purchase" + hint_text: "This is where two or more people are named as legal owners of the property after the purchase" + question_text: "Is this a joint purchase?" + + jointmore: + page_header: "" + check_answer_label: "More than 2 joint buyers" + hint_text: "" + question_text: "Are there more than 2 joint buyers of this property?" + + noint: + joint_purchase: + page_header: "" + check_answer_label: "Buyers interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyers weren’t interviewed in person" + question_text: "Were the buyers interviewed for any of the answers you will provide on this log?" + not_joint_purchase: + page_header: "" + check_answer_label: "Buyer interviewed in person?" + hint_text: "You should still try to answer all questions even if the buyer wasn’t interviewed in person" + question_text: "Was the buyer interviewed for any of the answers you will provide on this log?" + + privacynotice: + joint_purchase: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Buyers have seen the privacy notice?" + hint_text: "" + question_text: "Declaration" + not_joint_purchase: + page_header: "Ministry of Housing, Communities and Local Government privacy notice" + check_answer_label: "Buyer has seen the privacy notice?" + hint_text: "" + question_text: "Declaration" diff --git a/spec/models/form/lettings/pages/address_fallback_spec.rb b/spec/models/form/lettings/pages/address_fallback_spec.rb index d0b13ca5c..d3971d540 100644 --- a/spec/models/form/lettings/pages/address_fallback_spec.rb +++ b/spec/models/form/lettings/pages/address_fallback_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::AddressFallback, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q12 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/address_matcher_spec.rb b/spec/models/form/lettings/pages/address_matcher_spec.rb index 16f571754..9f1470c01 100644 --- a/spec/models/form/lettings/pages/address_matcher_spec.rb +++ b/spec/models/form/lettings/pages/address_matcher_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::AddressMatcher, type: :model do expect(page.id).to eq("address_matcher") end - it "has the correct header" do - expect(page.header).to eq("Find an address") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/address_spec.rb b/spec/models/form/lettings/pages/address_spec.rb index cb275e530..4b3f9713e 100644 --- a/spec/models/form/lettings/pages/address_spec.rb +++ b/spec/models/form/lettings/pages/address_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::Address, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q13 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb index e37d6efc4..0530cf445 100644 --- a/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb +++ b/spec/models/form/lettings/pages/care_home_charges_value_check_spec.rb @@ -10,10 +10,6 @@ RSpec.describe Form::Lettings::Pages::CareHomeChargesValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/created_by_spec.rb b/spec/models/form/lettings/pages/created_by_spec.rb index d78614c00..774b826ee 100644 --- a/spec/models/form/lettings/pages/created_by_spec.rb +++ b/spec/models/form/lettings/pages/created_by_spec.rb @@ -47,10 +47,6 @@ RSpec.describe Form::Lettings::Pages::CreatedBy, type: :model do expect(page.id).to eq("assigned_to") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb index d789a850a..0b3d770b3 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_age_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb index 3a9e37d47..f380a5cb9 100644 --- a/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/females_in_soft_age_range_in_pregnant_household_person_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::FemalesInSoftAgeRangeInPregnantHouseholdPe expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb index 9cf49add6..b095af406 100644 --- a/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb +++ b/spec/models/form/lettings/pages/first_time_property_let_as_social_housing_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::FirstTimePropertyLetAsSocialHousing, type: expect(page.id).to eq("first_time_property_let_as_social_housing") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb index 2e9b3a9c3..1f2986064 100644 --- a/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb +++ b/spec/models/form/lettings/pages/lead_tenant_ethnic_background_white_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::LeadTenantEthnicBackgroundWhite, type: :mo expect(page.id).to eq("lead_tenant_ethnic_background_white") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/location_spec.rb b/spec/models/form/lettings/pages/location_spec.rb index 6de0b59dd..d1fc9b978 100644 --- a/spec/models/form/lettings/pages/location_spec.rb +++ b/spec/models/form/lettings/pages/location_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::Location, type: :model do expect(page.id).to eq("location") end - it "has the correct header" do - expect(page.header).to eq("Location") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/managing_organisation_spec.rb b/spec/models/form/lettings/pages/managing_organisation_spec.rb index 1c4e3a8df..ca4d57642 100644 --- a/spec/models/form/lettings/pages/managing_organisation_spec.rb +++ b/spec/models/form/lettings/pages/managing_organisation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::ManagingOrganisation, type: :model do expect(page.id).to eq("managing_organisation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb b/spec/models/form/lettings/pages/max_rent_value_check_spec.rb index c11f9f412..273272d8b 100644 --- a/spec/models/form/lettings/pages/max_rent_value_check_spec.rb +++ b/spec/models/form/lettings/pages/max_rent_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::MaxRentValueCheck, type: :model do expect(page.id).to eq("max_rent_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "rent_in_soft_max_range?" => true }]) end diff --git a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb b/spec/models/form/lettings/pages/min_rent_value_check_spec.rb index 1b128dd80..950f2f43f 100644 --- a/spec/models/form/lettings/pages/min_rent_value_check_spec.rb +++ b/spec/models/form/lettings/pages/min_rent_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::MinRentValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb index 2df5e394b..551a3b070 100644 --- a/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/lettings/pages/multiple_partners_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Lettings::Pages::MultiplePartnersValueCheck, type: :model d expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/needs_type_spec.rb b/spec/models/form/lettings/pages/needs_type_spec.rb index a9e9d0fcc..bae2db6f4 100644 --- a/spec/models/form/lettings/pages/needs_type_spec.rb +++ b/spec/models/form/lettings/pages/needs_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::NeedsType, type: :model do expect(page.id).to eq("needs_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/net_income_value_check_spec.rb b/spec/models/form/lettings/pages/net_income_value_check_spec.rb index e21476fa5..523e02c8b 100644 --- a/spec/models/form/lettings/pages/net_income_value_check_spec.rb +++ b/spec/models/form/lettings/pages/net_income_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::NetIncomeValueCheck, type: :model do expect(page.id).to eq("net_income_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "net_income_soft_validation_triggered?" => true }]) end diff --git a/spec/models/form/lettings/pages/no_address_found_spec.rb b/spec/models/form/lettings/pages/no_address_found_spec.rb index 3f5dd7695..ad8c04e04 100644 --- a/spec/models/form/lettings/pages/no_address_found_spec.rb +++ b/spec/models/form/lettings/pages/no_address_found_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::NoAddressFound, type: :model do expect(page.id).to eq("no_address_found") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "address_options_present?" => false, "is_supported_housing?" => false, diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb index d62fccc13..286ac6183 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_age_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonAgeValueCh expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb index dca600e0f..205f19ae1 100644 --- a/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb +++ b/spec/models/form/lettings/pages/no_females_pregnant_household_person_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::NoFemalesPregnantHouseholdPersonValueCheck expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb index 9ad520451..a769f95cc 100644 --- a/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/lettings/pages/partner_under16_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Lettings::Pages::PartnerUnder16ValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/person_age_spec.rb b/spec/models/form/lettings/pages/person_age_spec.rb index 562d91cfa..c9a57c138 100644 --- a/spec/models/form/lettings/pages/person_age_spec.rb +++ b/spec/models/form/lettings/pages/person_age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Lettings::Pages::PersonAge, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_gender_identity_spec.rb b/spec/models/form/lettings/pages/person_gender_identity_spec.rb index b487c3cfd..9bd63037e 100644 --- a/spec/models/form/lettings/pages/person_gender_identity_spec.rb +++ b/spec/models/form/lettings/pages/person_gender_identity_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonGenderIdentity, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_known_spec.rb b/spec/models/form/lettings/pages/person_known_spec.rb index 7bc4bce83..6e6f22f75 100644 --- a/spec/models/form/lettings/pages/person_known_spec.rb +++ b/spec/models/form/lettings/pages/person_known_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonKnown, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to eq("You’ve given us the details for 1 person in the household") - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb index 4cebf77b7..ec00f0d75 100644 --- a/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_over_retirement_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonOverRetirementValueCheck, type: :mod expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb index a73e94482..a0ebb9cbc 100644 --- a/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb +++ b/spec/models/form/lettings/pages/person_relationship_to_lead_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonRelationshipToLead, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb index 13023e1d0..37ca94f9e 100644 --- a/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb +++ b/spec/models/form/lettings/pages/person_under_retirement_value_check_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonUnderRetirementValueCheck, type: :mo expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/person_working_situation_spec.rb b/spec/models/form/lettings/pages/person_working_situation_spec.rb index 9631a20a9..71ef0a8f2 100644 --- a/spec/models/form/lettings/pages/person_working_situation_spec.rb +++ b/spec/models/form/lettings/pages/person_working_situation_spec.rb @@ -11,10 +11,6 @@ RSpec.describe Form::Lettings::Pages::PersonWorkingSituation, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be nil end diff --git a/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb b/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb index 017ff5978..af8e7b5fc 100644 --- a/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb +++ b/spec/models/form/lettings/pages/previous_housing_situation_renewal_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::PreviousHousingSituationRenewal, type: :mo expect(page.id).to eq("previous_housing_situation_renewal") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/previous_housing_situation_spec.rb b/spec/models/form/lettings/pages/previous_housing_situation_spec.rb index 1baef7198..9c86a5827 100644 --- a/spec/models/form/lettings/pages/previous_housing_situation_spec.rb +++ b/spec/models/form/lettings/pages/previous_housing_situation_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::PreviousHousingSituation, type: :model do expect(page.id).to eq("previous_housing_situation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/previous_local_authority_spec.rb b/spec/models/form/lettings/pages/previous_local_authority_spec.rb index 7c5649b3f..9e6d91be3 100644 --- a/spec/models/form/lettings/pages/previous_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/previous_local_authority_spec.rb @@ -24,10 +24,6 @@ RSpec.describe Form::Lettings::Pages::PreviousLocalAuthority, type: :model do expect(page.id).to eq("previous_local_authority") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/previous_postcode_spec.rb b/spec/models/form/lettings/pages/previous_postcode_spec.rb index 83a3f44f3..eba9af065 100644 --- a/spec/models/form/lettings/pages/previous_postcode_spec.rb +++ b/spec/models/form/lettings/pages/previous_postcode_spec.rb @@ -24,10 +24,6 @@ RSpec.describe Form::Lettings::Pages::PreviousPostcode, type: :model do expect(page.id).to eq("previous_postcode") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_local_authority_spec.rb b/spec/models/form/lettings/pages/property_local_authority_spec.rb index b3f73e505..fe5363d97 100644 --- a/spec/models/form/lettings/pages/property_local_authority_spec.rb +++ b/spec/models/form/lettings/pages/property_local_authority_spec.rb @@ -28,10 +28,6 @@ RSpec.describe Form::Lettings::Pages::PropertyLocalAuthority, type: :model do expect(page.id).to eq("property_local_authority") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb b/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb index 67c6504b7..708485ff6 100644 --- a/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb +++ b/spec/models/form/lettings/pages/property_number_of_times_relet_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::PropertyNumberOfTimesRelet, type: :model d expect(page.id).to eq("property_number_of_times_relet") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_reference_spec.rb b/spec/models/form/lettings/pages/property_reference_spec.rb index ee53c3aae..59bd4440e 100644 --- a/spec/models/form/lettings/pages/property_reference_spec.rb +++ b/spec/models/form/lettings/pages/property_reference_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::PropertyReference, type: :model do expect(page.id).to eq("property_reference") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb index 06144b2b4..90da08fb6 100644 --- a/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/lettings/pages/property_wheelchair_accessible_spec.rb @@ -21,10 +21,6 @@ RSpec.describe Form::Lettings::Pages::PropertyWheelchairAccessible, type: :model expect(page.id).to eq("property_wheelchair_accessible") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/renewal_spec.rb b/spec/models/form/lettings/pages/renewal_spec.rb index aec06352d..edeeaff1b 100644 --- a/spec/models/form/lettings/pages/renewal_spec.rb +++ b/spec/models/form/lettings/pages/renewal_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::Renewal, type: :model do expect(page.id).to eq("renewal") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/rent_type_spec.rb b/spec/models/form/lettings/pages/rent_type_spec.rb index 0b3b6bf90..41dc0a1a9 100644 --- a/spec/models/form/lettings/pages/rent_type_spec.rb +++ b/spec/models/form/lettings/pages/rent_type_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::RentType, type: :model do expect(page.id).to eq("rent_type") end - it "has the correct header" do - expect(page.header).to eq("Rent Type") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/scheme_spec.rb b/spec/models/form/lettings/pages/scheme_spec.rb index 96d66da2b..6f0bb55de 100644 --- a/spec/models/form/lettings/pages/scheme_spec.rb +++ b/spec/models/form/lettings/pages/scheme_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::Scheme, type: :model do expect(page.id).to eq("scheme") end - it "has the correct header" do - expect(page.header).to eq("Scheme") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb b/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb index e2e1d1086..8df3c9a62 100644 --- a/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb +++ b/spec/models/form/lettings/pages/sheltered_accommodation_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::ShelteredAccommodation, type: :model do expect(page.id).to eq("sheltered_accommodation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb index 14388539c..6842f7d3e 100644 --- a/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/pages/starter_tenancy_type_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Lettings::Pages::StarterTenancyType, type: :model do expect(page.id).to eq("starter_tenancy_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/stock_owner_spec.rb b/spec/models/form/lettings/pages/stock_owner_spec.rb index bb0ddd3dc..557345dc8 100644 --- a/spec/models/form/lettings/pages/stock_owner_spec.rb +++ b/spec/models/form/lettings/pages/stock_owner_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::StockOwner, type: :model do expect(page.id).to eq("stock_owner") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb index d7463f694..88623c0bb 100644 --- a/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_length_periodic_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::TenancyLengthPeriodic, type: :model do expect(page.id).to eq "tenancy_length_periodic" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_length_spec.rb b/spec/models/form/lettings/pages/tenancy_length_spec.rb index aef5f3fd0..9b9657d21 100644 --- a/spec/models/form/lettings/pages/tenancy_length_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_length_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::TenancyLength, type: :model do expect(page.id).to eq "tenancy_length" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_start_date_spec.rb b/spec/models/form/lettings/pages/tenancy_start_date_spec.rb index 8157f1872..e183d9683 100644 --- a/spec/models/form/lettings/pages/tenancy_start_date_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_start_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::TenancyStartDate, type: :model do expect(page.id).to eq("tenancy_start_date") end - it "has the correct header" do - expect(page.header).to be nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenancy_type_spec.rb b/spec/models/form/lettings/pages/tenancy_type_spec.rb index e4b6a04e5..55bb119ff 100644 --- a/spec/models/form/lettings/pages/tenancy_type_spec.rb +++ b/spec/models/form/lettings/pages/tenancy_type_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Lettings::Pages::TenancyType, type: :model do expect(page.id).to eq "tenancy_type" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/tenant_code_spec.rb b/spec/models/form/lettings/pages/tenant_code_spec.rb index 636fbce83..25b124fe1 100644 --- a/spec/models/form/lettings/pages/tenant_code_spec.rb +++ b/spec/models/form/lettings/pages/tenant_code_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::TenantCode, type: :model do expect(page.id).to eq("tenant_code") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/uprn_confirmation_spec.rb b/spec/models/form/lettings/pages/uprn_confirmation_spec.rb index 1f66964f4..91bb7b759 100644 --- a/spec/models/form/lettings/pages/uprn_confirmation_spec.rb +++ b/spec/models/form/lettings/pages/uprn_confirmation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::UprnConfirmation, type: :model do expect(page.id).to eq("uprn_confirmation") end - it "has the correct header" do - expect(page.header).to eq("We found an address that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/uprn_selection_spec.rb b/spec/models/form/lettings/pages/uprn_selection_spec.rb index a2e8086d0..00dcd9508 100644 --- a/spec/models/form/lettings/pages/uprn_selection_spec.rb +++ b/spec/models/form/lettings/pages/uprn_selection_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Lettings::Pages::UprnSelection, type: :model do expect(page.id).to eq("uprn_selection") end - it "has the correct header" do - expect(page.header).to eq("We found some addresses that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/uprn_spec.rb b/spec/models/form/lettings/pages/uprn_spec.rb index c41de5f6a..2ab83c76a 100644 --- a/spec/models/form/lettings/pages/uprn_spec.rb +++ b/spec/models/form/lettings/pages/uprn_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Lettings::Pages::Uprn, type: :model do expect(page.id).to eq("uprn") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/pages/void_date_spec.rb b/spec/models/form/lettings/pages/void_date_spec.rb index 5e3cbd323..6fc5cf1c9 100644 --- a/spec/models/form/lettings/pages/void_date_spec.rb +++ b/spec/models/form/lettings/pages/void_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Lettings::Pages::VoidDate, type: :model do expect(page.id).to eq("void_date") end - it "has the correct header" do - expect(page.header).to eq("Void date") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb b/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb index 19995e950..b8323662c 100644 --- a/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb +++ b/spec/models/form/lettings/questions/address_line1_for_address_matcher_spec.rb @@ -16,18 +16,10 @@ RSpec.describe Form::Lettings::Questions::AddressLine1ForAddressMatcher, type: : expect(question.id).to eq("address_line1_input") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Find address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -40,10 +32,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine1ForAddressMatcher, type: : expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("Address line 1\nAA1 1AA") end diff --git a/spec/models/form/lettings/questions/address_line1_spec.rb b/spec/models/form/lettings/questions/address_line1_spec.rb index 7416ef97a..212e3be9b 100644 --- a/spec/models/form/lettings/questions/address_line1_spec.rb +++ b/spec/models/form/lettings/questions/address_line1_spec.rb @@ -15,18 +15,10 @@ RSpec.describe Form::Lettings::Questions::AddressLine1, type: :model do expect(question.id).to eq("address_line1") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Address lines 1 and 2") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine1, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/address_line2_spec.rb b/spec/models/form/lettings/questions/address_line2_spec.rb index 4948a77bf..430a6d18b 100644 --- a/spec/models/form/lettings/questions/address_line2_spec.rb +++ b/spec/models/form/lettings/questions/address_line2_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine2, type: :model do expect(question.id).to eq("address_line2") end - it "has the correct header" do - expect(question.header).to eq("Address line 2 (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::AddressLine2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/age1_known_spec.rb b/spec/models/form/lettings/questions/age1_known_spec.rb index 5665f27ac..6ec594359 100644 --- a/spec/models/form/lettings/questions/age1_known_spec.rb +++ b/spec/models/form/lettings/questions/age1_known_spec.rb @@ -33,18 +33,10 @@ RSpec.describe Form::Lettings::Questions::Age1Known, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - it "has the correct id" do expect(question.id).to eq("age1_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the lead tenant’s age?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age1" => [0], @@ -69,20 +61,4 @@ RSpec.describe Form::Lettings::Questions::Age1Known, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("The ’lead’ or ’main’ tenant is the person in the household who does the most paid work. If several people do the same amount of paid work, the lead tenant is whoever is the oldest.") - end - end end diff --git a/spec/models/form/lettings/questions/age_known_spec.rb b/spec/models/form/lettings/questions/age_known_spec.rb index 8e4c60fe6..5f7946a16 100644 --- a/spec/models/form/lettings/questions/age_known_spec.rb +++ b/spec/models/form/lettings/questions/age_known_spec.rb @@ -26,23 +26,11 @@ RSpec.describe Form::Lettings::Questions::AgeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - context "with person 2" do it "has the correct id" do expect(question.id).to eq("age2_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 2’s age?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age2" => [0], @@ -76,10 +64,6 @@ RSpec.describe Form::Lettings::Questions::AgeKnown, type: :model do expect(question.id).to eq("age3_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 3’s age?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age3" => [0], diff --git a/spec/models/form/lettings/questions/age_spec.rb b/spec/models/form/lettings/questions/age_spec.rb index 3fe34e51b..4ec1ee985 100644 --- a/spec/models/form/lettings/questions/age_spec.rb +++ b/spec/models/form/lettings/questions/age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.page).to eq(page) end - it "has the correct header" do - expect(question.header).to eq("Age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -24,20 +20,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.derived?(nil)).to be false end - context "when child" do - let(:person_type) { "child" } - - it "has the correct hint" do - expect(question.hint_text).to eq("For a child under 1, enter 1") - end - end - - context "when not child" do - it "has no hint" do - expect(question.hint_text).to be nil - end - end - it "has the correct min" do expect(question.min).to eq(1) end @@ -55,10 +37,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.id).to eq("age2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([ { @@ -80,10 +58,6 @@ RSpec.describe Form::Lettings::Questions::Age, type: :model do expect(question.id).to eq("age3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([ { diff --git a/spec/models/form/lettings/questions/beds_spec.rb b/spec/models/form/lettings/questions/beds_spec.rb index e594a4140..0ae62d049 100644 --- a/spec/models/form/lettings/questions/beds_spec.rb +++ b/spec/models/form/lettings/questions/beds_spec.rb @@ -7,28 +7,6 @@ RSpec.describe Form::Lettings::Questions::Beds, type: :model do let(:subsection) { instance_double(Form::Subsection, form:) } let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } - describe "the hint text" do - context "when the start date is before 24/25" do - before do - allow(form).to receive(:start_year_after_2024?).and_return false - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("If shared accommodation, enter the number of bedrooms occupied by this household. A bedsit has 1 bedroom.") - end - end - - context "when the start date is 24/25 or after" do - before do - allow(form).to receive(:start_year_after_2024?).and_return true - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("If shared accommodation, enter the number of bedrooms occupied by this household.") - end - end - end - describe "whether the field is derived" do context "when the log is a bedsit" do let(:log) { build(:lettings_log, unittype_gn: 2) } diff --git a/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb b/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb index 5b14949a3..0e8977d7a 100644 --- a/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb +++ b/spec/models/form/lettings/questions/care_home_charges_value_check_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Lettings::Questions::CareHomeChargesValueCheck, type: :mode expect(question.id).to eq("carehome_charges_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure there are no care home charges?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Care home charges confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -30,10 +22,6 @@ RSpec.describe Form::Lettings::Questions::CareHomeChargesValueCheck, type: :mode expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/lettings/questions/county_spec.rb b/spec/models/form/lettings/questions/county_spec.rb index c3473e75d..05707112d 100644 --- a/spec/models/form/lettings/questions/county_spec.rb +++ b/spec/models/form/lettings/questions/county_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::County, type: :model do expect(question.id).to eq("county") end - it "has the correct header" do - expect(question.header).to eq("County (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("County") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::County, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/created_by_id_spec.rb b/spec/models/form/lettings/questions/created_by_id_spec.rb index 82c0aa65d..1cae12396 100644 --- a/spec/models/form/lettings/questions/created_by_id_spec.rb +++ b/spec/models/form/lettings/questions/created_by_id_spec.rb @@ -17,22 +17,10 @@ RSpec.describe Form::Lettings::Questions::CreatedById, type: :model do expect(question.id).to eq("assigned_to_id") end - it "has the correct header" do - expect(question.header).to eq("Which user are you creating this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Log owner") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer options" do expect(question.answer_options).to eq({ "" => "Select an option" }) end diff --git a/spec/models/form/lettings/questions/declaration_spec.rb b/spec/models/form/lettings/questions/declaration_spec.rb index ea1e10402..bf8743520 100644 --- a/spec/models/form/lettings/questions/declaration_spec.rb +++ b/spec/models/form/lettings/questions/declaration_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do expect(question.id).to eq("declaration") end - it "has the correct header" do - expect(question.header).to eq("Declaration") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Tenant has seen the privacy notice") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - context "when the form year is before 2024" do before do allow(form).to receive(:start_year_after_2024?).and_return(false) diff --git a/spec/models/form/lettings/questions/details_known_spec.rb b/spec/models/form/lettings/questions/details_known_spec.rb index abedc3f11..43f90385a 100644 --- a/spec/models/form/lettings/questions/details_known_spec.rb +++ b/spec/models/form/lettings/questions/details_known_spec.rb @@ -19,23 +19,11 @@ RSpec.describe Form::Lettings::Questions::DetailsKnown, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You must provide details for everyone in the household if you know them.") - end - context "with person 2" do it "has the correct id" do expect(question.id).to eq("details_known_2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 2") - end - - it "has the correct header" do - expect(question.header).to eq("Do you know details for person 2?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end @@ -48,14 +36,6 @@ RSpec.describe Form::Lettings::Questions::DetailsKnown, type: :model do expect(question.id).to eq("details_known_3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 3") - end - - it "has the correct header" do - expect(question.header).to eq("Do you know details for person 3?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end diff --git a/spec/models/form/lettings/questions/ethnic_white_spec.rb b/spec/models/form/lettings/questions/ethnic_white_spec.rb index cff675d64..7857893a1 100644 --- a/spec/models/form/lettings/questions/ethnic_white_spec.rb +++ b/spec/models/form/lettings/questions/ethnic_white_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes the lead tenant’s White background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -48,10 +40,6 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end end context "with 2024/25 form" do @@ -68,10 +56,6 @@ RSpec.describe Form::Lettings::Questions::EthnicWhite, type: :model do "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end end it "has the correct check_answers_card_number" do diff --git a/spec/models/form/lettings/questions/gender_identity1_spec.rb b/spec/models/form/lettings/questions/gender_identity1_spec.rb index 67c7d54c8..2a943cbe0 100644 --- a/spec/models/form/lettings/questions/gender_identity1_spec.rb +++ b/spec/models/form/lettings/questions/gender_identity1_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Lettings::Questions::GenderIdentity1, type: :model do expect(question.id).to eq("sex1") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes the lead tenant’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s gender identity") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end @@ -46,24 +38,4 @@ RSpec.describe Form::Lettings::Questions::GenderIdentity1, type: :model do "R" => { "value" => "Tenant prefers not to say" }, }) end - - context "with form year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end - end - - context "with form year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end end diff --git a/spec/models/form/lettings/questions/hb_spec.rb b/spec/models/form/lettings/questions/hb_spec.rb index 20e775fcc..ed8f19cd5 100644 --- a/spec/models/form/lettings/questions/hb_spec.rb +++ b/spec/models/form/lettings/questions/hb_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Hb, type: :model do expect(question.id).to eq("hb") end - it "has the correct header" do - expect(question.header).to eq("Is the household likely to be receiving any of these housing-related benefits?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Housing-related benefits received") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -51,22 +43,6 @@ RSpec.describe Form::Lettings::Questions::Hb, type: :model do }) end - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is about when the tenant is in their new let. If they are unsure about the situation for their new let and their financial and working situation hasn’t changed significantly, answer based on what housing-related benefits they currently receive.") - end - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/lettings/questions/homeless_spec.rb b/spec/models/form/lettings/questions/homeless_spec.rb index e9dfbcaef..40beb9698 100644 --- a/spec/models/form/lettings/questions/homeless_spec.rb +++ b/spec/models/form/lettings/questions/homeless_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Lettings::Questions::Homeless, type: :model do expect(question.id).to eq("homeless") end - it "has the correct header" do - expect(question.header).to eq("Did the household experience homelessness immediately before this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Household homeless immediately before letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/housingneeds_other_spec.rb b/spec/models/form/lettings/questions/housingneeds_other_spec.rb index 9e1e628ff..f7be373e1 100644 --- a/spec/models/form/lettings/questions/housingneeds_other_spec.rb +++ b/spec/models/form/lettings/questions/housingneeds_other_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::HousingneedsOther, type: :model do expect(question.id).to eq("housingneeds_other") end - it "has the correct header" do - expect(question.header).to eq("Do they have any other disabled access needs?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Other disabled access needs") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/irproduct_other_spec.rb b/spec/models/form/lettings/questions/irproduct_other_spec.rb index 2406e4618..ca3b3ff8e 100644 --- a/spec/models/form/lettings/questions/irproduct_other_spec.rb +++ b/spec/models/form/lettings/questions/irproduct_other_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::IrproductOther, type: :model do expect(question.id).to eq("irproduct_other") end - it "has the correct header" do - expect(question.header).to eq("Name of rent product") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Product name") - end - it "has the correct type" do expect(question.type).to eq("text") end diff --git a/spec/models/form/lettings/questions/is_carehome_spec.rb b/spec/models/form/lettings/questions/is_carehome_spec.rb index 77fb7804b..958873599 100644 --- a/spec/models/form/lettings/questions/is_carehome_spec.rb +++ b/spec/models/form/lettings/questions/is_carehome_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::IsCarehome, type: :model do expect(question.id).to eq("is_carehome") end - it "has the correct header" do - expect(question.header).to eq("Is this accommodation a care home?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Care home accommodation") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/joint_spec.rb b/spec/models/form/lettings/questions/joint_spec.rb index 7c5b26402..1207d97d4 100644 --- a/spec/models/form/lettings/questions/joint_spec.rb +++ b/spec/models/form/lettings/questions/joint_spec.rb @@ -23,22 +23,10 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do expect(question.id).to eq("joint") end - it "has the correct header" do - expect(question.header).to eq("Is this a joint tenancy?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this a joint tenancy?") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, @@ -51,14 +39,4 @@ RSpec.describe Form::Lettings::Questions::Joint, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is where two or more people are named on the tenancy agreement") - end - end end diff --git a/spec/models/form/lettings/questions/layear_spec.rb b/spec/models/form/lettings/questions/layear_spec.rb index 7d3ec681c..04296beae 100644 --- a/spec/models/form/lettings/questions/layear_spec.rb +++ b/spec/models/form/lettings/questions/layear_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Layear, type: :model do expect(question.id).to eq("layear") end - it "has the correct header" do - expect(question.header).to eq("How long has the household continuously lived in the local authority area of the new letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of time in local authority area") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/letting_allocation_spec.rb b/spec/models/form/lettings/questions/letting_allocation_spec.rb index ccd0f8a53..63c750e5d 100644 --- a/spec/models/form/lettings/questions/letting_allocation_spec.rb +++ b/spec/models/form/lettings/questions/letting_allocation_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::LettingAllocation, type: :model do expect(question.id).to eq("letting_allocation") end - it "has the correct header" do - expect(question.header).to eq("How was this letting allocated?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Allocation system") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end diff --git a/spec/models/form/lettings/questions/location_id_spec.rb b/spec/models/form/lettings/questions/location_id_spec.rb index ac3cfb8b5..2b5572cb5 100644 --- a/spec/models/form/lettings/questions/location_id_spec.rb +++ b/spec/models/form/lettings/questions/location_id_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do expect(question.id).to eq("location_id") end - it "has the correct header" do - expect(question.header).to eq("Which location is this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Location") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -177,16 +169,6 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do end end - context "with collection year on or after 2023" do - before do - allow(form).to receive(:start_date).and_return(Time.zone.local(2023, 4, 1)) - end - - it "has the correct header" do - expect(question.header).to eq("Which location is this letting for?") - end - end - describe "partial guidance" do it "shows shows correct top_guidance_partial" do expect(question.top_guidance_partial).to eq("finding_location") diff --git a/spec/models/form/lettings/questions/managing_organisation_spec.rb b/spec/models/form/lettings/questions/managing_organisation_spec.rb index 99319fc71..776a873a6 100644 --- a/spec/models/form/lettings/questions/managing_organisation_spec.rb +++ b/spec/models/form/lettings/questions/managing_organisation_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::ManagingOrganisation, type: :model do expect(question.id).to eq("managing_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation manages this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Managing agent") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "#displayed_answer_options" do let(:options) { { "" => "Select an option" } } diff --git a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb index 0fea335c4..6fa0784e4 100644 --- a/spec/models/form/lettings/questions/max_rent_value_check_spec.rb +++ b/spec/models/form/lettings/questions/max_rent_value_check_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::MaxRentValueCheck, type: :model do expect(question.id).to eq("rent_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Total rent confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end - it "has the correct hint" do - expect(question.hint_text).to eq("Check the following:") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb index fec1e7d97..c3d8a16bc 100644 --- a/spec/models/form/lettings/questions/min_rent_value_check_spec.rb +++ b/spec/models/form/lettings/questions/min_rent_value_check_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::MinRentValueCheck, type: :model do expect(question.id).to eq("rent_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Total rent confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end - it "has the correct hint" do - expect(question.hint_text).to eq("Check the following:") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb b/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb index d946468b0..bc8d2d3a6 100644 --- a/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb +++ b/spec/models/form/lettings/questions/multiple_partners_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::MultiplePartnersValueCheck, type: :mod expect(question.id).to eq("multiple_partners_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Multiple partners confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::MultiplePartnersValueCheck, type: :mod expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/lettings/questions/nationality_all_group_spec.rb b/spec/models/form/lettings/questions/nationality_all_group_spec.rb index 5be7f13a5..8ef93a98a 100644 --- a/spec/models/form/lettings/questions/nationality_all_group_spec.rb +++ b/spec/models/form/lettings/questions/nationality_all_group_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::NationalityAllGroup, type: :model do expect(question.id).to eq("nationality_all_group") end - it "has the correct header" do - expect(question.header).to eq("What is the nationality of the lead tenant?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s nationality") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("If the lead tenant is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the tenant should decide which country to enter.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "826" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/lettings/questions/nationality_all_spec.rb b/spec/models/form/lettings/questions/nationality_all_spec.rb index 9c274e06c..a4d187a16 100644 --- a/spec/models/form/lettings/questions/nationality_all_spec.rb +++ b/spec/models/form/lettings/questions/nationality_all_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::NationalityAll, type: :model do expect(question.id).to eq("nationality_all") end - it "has the correct header" do - expect(question.header).to eq("Enter a nationality") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s nationality") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options.count).to eq(203) end diff --git a/spec/models/form/lettings/questions/nationality_spec.rb b/spec/models/form/lettings/questions/nationality_spec.rb index 600ef2692..5bdebc57e 100644 --- a/spec/models/form/lettings/questions/nationality_spec.rb +++ b/spec/models/form/lettings/questions/nationality_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::Nationality, type: :model do expect(question.id).to eq("national") end - it "has the correct header" do - expect(question.header).to eq("What is the nationality of the lead tenant?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Lead tenant’s nationality") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("The lead tenant is the person in the household who does the most paid work. If several people do the same paid work, the lead tenant is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "18" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/lettings/questions/needs_type_spec.rb b/spec/models/form/lettings/questions/needs_type_spec.rb index eafc9bba6..c63800413 100644 --- a/spec/models/form/lettings/questions/needs_type_spec.rb +++ b/spec/models/form/lettings/questions/needs_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::NeedsType, type: :model do expect(question.id).to eq("needstype") end - it "has the correct header" do - expect(question.header).to eq("What is the needs type?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Needs type") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/no_address_found_spec.rb b/spec/models/form/lettings/questions/no_address_found_spec.rb index 221ab6688..472642288 100644 --- a/spec/models/form/lettings/questions/no_address_found_spec.rb +++ b/spec/models/form/lettings/questions/no_address_found_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Lettings::Questions::NoAddressFound, type: :model do expect(question.id).to eq("address_search_value_check") end - it "has the correct header" do - expect(question.header).to eq("No address found") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -30,10 +22,6 @@ RSpec.describe Form::Lettings::Questions::NoAddressFound, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to be_nil end diff --git a/spec/models/form/lettings/questions/offered_spec.rb b/spec/models/form/lettings/questions/offered_spec.rb index 753ab459e..235be5210 100644 --- a/spec/models/form/lettings/questions/offered_spec.rb +++ b/spec/models/form/lettings/questions/offered_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Lettings::Questions::Offered, type: :model do expect(question.id).to eq "offered" end - it "has the correct header" do - expect(question.header).to eq "How many times was the property offered between becoming vacant and this letting?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Times previously offered since becoming available." - end - it "has the correct type" do expect(question.type).to eq "numeric" end @@ -37,8 +29,4 @@ RSpec.describe Form::Lettings::Questions::Offered, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - it "has the correct hint_text" do - expect(question.hint_text).to eq "Do not include the offer that led to this letting. This is after the last tenancy ended. If the property is being offered for let for the first time, enter 0." - end end diff --git a/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb b/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb index dfff2a22c..76c8f413d 100644 --- a/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb +++ b/spec/models/form/lettings/questions/partner_under16_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::PartnerUnder16ValueCheck, type: :model expect(question.id).to eq("partner_under_16_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Partner under 16 confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::PartnerUnder16ValueCheck, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/lettings/questions/period_spec.rb b/spec/models/form/lettings/questions/period_spec.rb index 88b11deef..6adbac94f 100644 --- a/spec/models/form/lettings/questions/period_spec.rb +++ b/spec/models/form/lettings/questions/period_spec.rb @@ -5,10 +5,6 @@ RSpec.describe Form::Lettings::Questions::Period, type: :model do let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) } - it "has the correct hint" do - expect(question.hint_text).to eq("Select how often the household is charged. This may be different to how often they pay.") - end - it "has correct answer options" do expect(question.answer_options).to eq( { diff --git a/spec/models/form/lettings/questions/person_gender_identity_spec.rb b/spec/models/form/lettings/questions/person_gender_identity_spec.rb index 60a0608e5..f9730739c 100644 --- a/spec/models/form/lettings/questions/person_gender_identity_spec.rb +++ b/spec/models/form/lettings/questions/person_gender_identity_spec.rb @@ -26,39 +26,11 @@ RSpec.describe Form::Lettings::Questions::PersonGenderIdentity, type: :model do expect(question.derived?(nil)).to be false end - context "with form year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - end - - context "with form year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end - context "with person 2" do it "has the correct id" do expect(question.id).to eq("sex2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s gender identity") - end - - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 2’s gender identity?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end @@ -71,14 +43,6 @@ RSpec.describe Form::Lettings::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s gender identity") - end - - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 3’s gender identity?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end diff --git a/spec/models/form/lettings/questions/person_relationship_spec.rb b/spec/models/form/lettings/questions/person_relationship_spec.rb index 65e9746d9..20d05e316 100644 --- a/spec/models/form/lettings/questions/person_relationship_spec.rb +++ b/spec/models/form/lettings/questions/person_relationship_spec.rb @@ -27,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do "divider" => { "value" => true }) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has correct conditional for" do expect(question.conditional_for).to be nil end @@ -44,17 +40,9 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do expect(question.id).to eq("relat2") end - it "has the correct header" do - expect(question.header).to eq("What is person 2’s relationship to the lead tenant?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s relationship to the lead tenant") - end end context "with person 3" do @@ -64,16 +52,8 @@ RSpec.describe Form::Lettings::Questions::PersonRelationship, type: :model do expect(question.id).to eq("relat3") end - it "has the correct header" do - expect(question.header).to eq("What is person 3’s relationship to the lead tenant?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s relationship to the lead tenant") - end end end diff --git a/spec/models/form/lettings/questions/person_working_situation_spec.rb b/spec/models/form/lettings/questions/person_working_situation_spec.rb index 03cd60019..4dd6a0065 100644 --- a/spec/models/form/lettings/questions/person_working_situation_spec.rb +++ b/spec/models/form/lettings/questions/person_working_situation_spec.rb @@ -41,10 +41,6 @@ RSpec.describe Form::Lettings::Questions::PersonWorkingSituation, type: :model d "divider" => { "value" => true }) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has correct conditional for" do expect(question.conditional_for).to be nil end @@ -58,17 +54,9 @@ RSpec.describe Form::Lettings::Questions::PersonWorkingSituation, type: :model d expect(question.id).to eq("ecstat2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 2’s working situation?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s working situation") - end end context "with person 3" do @@ -78,16 +66,8 @@ RSpec.describe Form::Lettings::Questions::PersonWorkingSituation, type: :model d expect(question.id).to eq("ecstat3") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes person 3’s working situation?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s working situation") - end end end diff --git a/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb b/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb index e59541efd..1a8e8d0d4 100644 --- a/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb +++ b/spec/models/form/lettings/questions/postcode_for_address_matcher_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForAddressMatcher, type: :mode expect(question.id).to eq("postcode_full_input") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq(nil) - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -36,10 +28,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForAddressMatcher, type: :mode expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("AA1 1AA") end diff --git a/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb b/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb index 0ccc8c26b..587f2648a 100644 --- a/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb +++ b/spec/models/form/lettings/questions/postcode_for_full_address_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForFullAddress, type: :model d expect(question.id).to eq("postcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Postcode") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::PostcodeForFullAddress, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/lettings/questions/ppcodenk_spec.rb b/spec/models/form/lettings/questions/ppcodenk_spec.rb index cc109c75f..8a29b032d 100644 --- a/spec/models/form/lettings/questions/ppcodenk_spec.rb +++ b/spec/models/form/lettings/questions/ppcodenk_spec.rb @@ -33,18 +33,10 @@ RSpec.describe Form::Lettings::Questions::Ppcodenk, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - it "has the correct id" do expect(question.id).to eq("ppcodenk") end - it "has the correct header" do - expect(question.header).to eq("Do you know the postcode of the household’s last settled accommodation?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "ppostcode_full" => [0], @@ -62,20 +54,4 @@ RSpec.describe Form::Lettings::Questions::Ppcodenk, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s ‘last settled home’.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.") - end - end end diff --git a/spec/models/form/lettings/questions/previous_la_known_spec.rb b/spec/models/form/lettings/questions/previous_la_known_spec.rb index fea17d56a..defb56bdf 100644 --- a/spec/models/form/lettings/questions/previous_la_known_spec.rb +++ b/spec/models/form/lettings/questions/previous_la_known_spec.rb @@ -33,18 +33,10 @@ RSpec.describe Form::Lettings::Questions::PreviousLaKnown, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Do you know the local authority of the household’s last settled accommodation?") - end - it "has the correct id" do expect(question.id).to eq("previous_la_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the local authority of the household’s last settled accommodation?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "prevloc" => [1], @@ -62,20 +54,4 @@ RSpec.describe Form::Lettings::Questions::PreviousLaKnown, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s ‘last settled home’.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is the tenant’s last long-standing home. It is where the tenant was living before any period in temporary accommodation, sleeping rough or otherwise homeless.") - end - end end diff --git a/spec/models/form/lettings/questions/previous_let_type_spec.rb b/spec/models/form/lettings/questions/previous_let_type_spec.rb index bf9cf78f9..0739fe386 100644 --- a/spec/models/form/lettings/questions/previous_let_type_spec.rb +++ b/spec/models/form/lettings/questions/previous_let_type_spec.rb @@ -21,22 +21,10 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do expect(question.id).to eq "unitletas" end - it "has the correct header" do - expect(question.header).to eq "What type was the property most recently let as?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Most recent let type" - end - it "has the correct type" do expect(question.type).to eq "radio" end - it "has the correct hint_text" do - expect(question.hint_text).to eq "" - end - it "is not marked as derived" do expect(question.derived?(nil)).to be false end @@ -71,9 +59,5 @@ RSpec.describe Form::Lettings::Questions::PreviousLetType, type: :model do "3" => { "value" => "Don’t know" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is the rent type of the previous tenancy in this property.") - end end end diff --git a/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb b/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb index 724b6f143..d672c573b 100644 --- a/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb +++ b/spec/models/form/lettings/questions/previous_tenure_renewal_spec.rb @@ -9,18 +9,10 @@ RSpec.describe Form::Lettings::Questions::PreviousTenureRenewal, type: :model do expect(question.id).to eq("prevten") end - it "has the correct header" do - expect(question.header).to eq("Where was the household immediately before this letting?") - end - it "has correct page" do expect(question.page).to eq(page) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Where was the household immediately before this letting?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -29,11 +21,6 @@ RSpec.describe Form::Lettings::Questions::PreviousTenureRenewal, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us this letting is a renewal. We have removed some options because of this.

- This is where the household was the night before they moved into this new let.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "34" => { "value" => "Specialist retirement housing" }, diff --git a/spec/models/form/lettings/questions/previous_tenure_spec.rb b/spec/models/form/lettings/questions/previous_tenure_spec.rb index 83c4d12de..2b8dcc338 100644 --- a/spec/models/form/lettings/questions/previous_tenure_spec.rb +++ b/spec/models/form/lettings/questions/previous_tenure_spec.rb @@ -9,18 +9,10 @@ RSpec.describe Form::Lettings::Questions::PreviousTenure, type: :model do expect(question.id).to eq("prevten") end - it "has the correct header" do - expect(question.header).to eq("Where was the household immediately before this letting?") - end - it "has correct page" do expect(question.page).to eq(page) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Where was the household immediately before this letting?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -29,10 +21,6 @@ RSpec.describe Form::Lettings::Questions::PreviousTenure, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("This is where the household was the night before they moved into this new let.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "30" => { "value" => "Fixed-term local authority general needs tenancy" }, diff --git a/spec/models/form/lettings/questions/property_reference_spec.rb b/spec/models/form/lettings/questions/property_reference_spec.rb index 970bead96..0cbabcd66 100644 --- a/spec/models/form/lettings/questions/property_reference_spec.rb +++ b/spec/models/form/lettings/questions/property_reference_spec.rb @@ -16,22 +16,10 @@ RSpec.describe Form::Lettings::Questions::PropertyReference, type: :model do expect(question.id).to eq("propcode") end - it "has the correct header" do - expect(question.header).to eq("What is the property reference?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property reference") - end - it "has the correct type" do expect(question.type).to eq("text") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is how you usually refer to this property on your own systems.") - end - it "has the correct width" do expect(question.width).to eq(10) end diff --git a/spec/models/form/lettings/questions/reason_renewal_spec.rb b/spec/models/form/lettings/questions/reason_renewal_spec.rb index 6d507d1f6..02abe1527 100644 --- a/spec/models/form/lettings/questions/reason_renewal_spec.rb +++ b/spec/models/form/lettings/questions/reason_renewal_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do expect(question.id).to eq("reason") end - it "has the correct header" do - expect(question.header).to eq("What is the tenant’s main reason for the household leaving their last settled home?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Reason for leaving last settled home") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReasonRenewal, type: :model do expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us this letting is a renewal. We have removed some options because of this.") - end - it "has the correct conditional_for" do expect(question.conditional_for).to eq({ "reasonother" => [20] }) end diff --git a/spec/models/form/lettings/questions/reason_spec.rb b/spec/models/form/lettings/questions/reason_spec.rb index ab7d4202d..81fd7a5c1 100644 --- a/spec/models/form/lettings/questions/reason_spec.rb +++ b/spec/models/form/lettings/questions/reason_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do expect(question.id).to eq("reason") end - it "has the correct header" do - expect(question.header).to eq("What is the tenant’s main reason for the household leaving their last settled home?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Reason for leaving last settled home") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -48,10 +40,6 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do end context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation or sleeping rough, their last settled home is where they were living previously.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "40" => { "value" => "End of assured shorthold tenancy (no fault)" }, @@ -99,10 +87,6 @@ RSpec.describe Form::Lettings::Questions::Reason, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(true) end - it "has the correct hint" do - expect(question.hint_text).to eq("The tenant’s ‘last settled home’ is their last long-standing home. For tenants who were in temporary accommodation, sleeping rough or otherwise homeless, their last settled home is where they were living previously.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "50" => { "value" => "End of social or private sector tenancy - no fault" }, diff --git a/spec/models/form/lettings/questions/reasonpref_spec.rb b/spec/models/form/lettings/questions/reasonpref_spec.rb index ac39d8ba0..5957d4979 100644 --- a/spec/models/form/lettings/questions/reasonpref_spec.rb +++ b/spec/models/form/lettings/questions/reasonpref_spec.rb @@ -35,18 +35,10 @@ RSpec.describe Form::Lettings::Questions::Reasonpref, type: :model do }) end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Household given reasonable preference") - end - it "has the correct id" do expect(question.id).to eq("reasonpref") end - it "has the correct header" do - expect(question.header).to eq("Was the household given ‘reasonable preference’ by the local authority?") - end - it "has correct conditional for" do expect(question.conditional_for).to be_nil end @@ -58,20 +50,4 @@ RSpec.describe Form::Lettings::Questions::Reasonpref, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end - - context "with 2023/24 form" do - it "has the correct hint" do - expect(question.hint_text).to eq("Households may be given ‘reasonable preference’ for social housing, also known as ‘priority need’, by the local authority.") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("Households may be given ‘reasonable preference’ for social housing under one or more specific categories by the local authority. This is also known as ‘priority need’.") - end - end end diff --git a/spec/models/form/lettings/questions/referral_prp_spec.rb b/spec/models/form/lettings/questions/referral_prp_spec.rb index f0fdb47e7..e11bf250c 100644 --- a/spec/models/form/lettings/questions/referral_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_prp_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReferralPrp, type: :model do expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us that the needs type is general needs. We have removed some options because of this.") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/referral_spec.rb b/spec/models/form/lettings/questions/referral_spec.rb index 5c7bc1735..b3f526697 100644 --- a/spec/models/form/lettings/questions/referral_spec.rb +++ b/spec/models/form/lettings/questions/referral_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::Referral, type: :model do expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us that you are a local authority and that the needs type is general needs. We have removed some options because of this.") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb index de209092c..ab13acd26 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_prp_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousingPrp, type: :mo expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb index 0a09415a6..5e05bf65b 100644 --- a/spec/models/form/lettings/questions/referral_supported_housing_spec.rb +++ b/spec/models/form/lettings/questions/referral_supported_housing_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model expect(question.id).to eq("referral") end - it "has the correct header" do - expect(question.header).to eq("What was the source of referral for this letting?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Source of referral for letting") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Lettings::Questions::ReferralSupportedHousing, type: :model expect(question.check_answers_card_number).to eq(0) end - it "has the correct hint" do - expect(question.hint_text).to eq("You told us that you are a local authority. We have removed some options because of this.") - end - it "is not marked as derived" do expect(question).not_to be_derived(nil) end diff --git a/spec/models/form/lettings/questions/renewal_spec.rb b/spec/models/form/lettings/questions/renewal_spec.rb index 1b921070c..27fe1bf86 100644 --- a/spec/models/form/lettings/questions/renewal_spec.rb +++ b/spec/models/form/lettings/questions/renewal_spec.rb @@ -23,22 +23,10 @@ RSpec.describe Form::Lettings::Questions::Renewal, type: :model do expect(question.id).to eq("renewal") end - it "has the correct header" do - expect(question.header).to eq("Is this letting a renewal?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property renewal") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("A renewal is a letting to the same tenant in the same property. If the property was previously being used as temporary accommodation, then answer 'no'") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, @@ -49,18 +37,4 @@ RSpec.describe Form::Lettings::Questions::Renewal, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct header" do - expect(question.header).to eq("Is this letting a renewal of social housing to the same tenant in the same property?") - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("If the property was previously being used as temporary accommodation, then answer 'no'") - end - end end diff --git a/spec/models/form/lettings/questions/rent_type_spec.rb b/spec/models/form/lettings/questions/rent_type_spec.rb index f23ea45b4..15183ce6b 100644 --- a/spec/models/form/lettings/questions/rent_type_spec.rb +++ b/spec/models/form/lettings/questions/rent_type_spec.rb @@ -23,22 +23,10 @@ RSpec.describe Form::Lettings::Questions::RentType, type: :model do expect(question.id).to eq("rent_type") end - it "has the correct header" do - expect(question.header).to eq("What is the rent type?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Rent type") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct conditional_for" do expect(question.conditional_for).to eq({ "irproduct_other" => [5] }) end diff --git a/spec/models/form/lettings/questions/rsnvac_spec.rb b/spec/models/form/lettings/questions/rsnvac_spec.rb index 8f796d548..45469cebb 100644 --- a/spec/models/form/lettings/questions/rsnvac_spec.rb +++ b/spec/models/form/lettings/questions/rsnvac_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Lettings::Questions::Rsnvac, type: :model do expect(question.id).to eq("rsnvac") end - it "has the correct header" do - expect(question.header).to eq("What is the reason for the property being vacant?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Vacancy reason") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/lettings/questions/scheme_id_spec.rb b/spec/models/form/lettings/questions/scheme_id_spec.rb index 81bb23ca1..c490cded4 100644 --- a/spec/models/form/lettings/questions/scheme_id_spec.rb +++ b/spec/models/form/lettings/questions/scheme_id_spec.rb @@ -23,39 +23,10 @@ RSpec.describe Form::Lettings::Questions::SchemeId, type: :model do expect(question.id).to eq("scheme_id") end - it "has the correct header" do - expect(question.header).to eq("What scheme is this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Scheme name") - end - it "has the correct type" do expect(question.type).to eq("select") end - context "when 2023" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Enter postcode or scheme name") - end - end - - context "when 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Enter postcode or scheme name.

- A supported housing scheme provides shared or self-contained housing for a particular client group, for example younger or vulnerable people.") - end - end - it "has the correct conditional_for" do expect(question.conditional_for).to be_nil end diff --git a/spec/models/form/lettings/questions/sheltered_spec.rb b/spec/models/form/lettings/questions/sheltered_spec.rb index 15668648f..33b1007d2 100644 --- a/spec/models/form/lettings/questions/sheltered_spec.rb +++ b/spec/models/form/lettings/questions/sheltered_spec.rb @@ -21,22 +21,10 @@ RSpec.describe Form::Lettings::Questions::Sheltered, type: :model do expect(question.id).to eq "sheltered" end - it "has the correct header" do - expect(question.header).to eq "Is this letting in sheltered accommodation?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Is this letting in sheltered accommodation?" - end - it "has the correct type" do expect(question.type).to eq "radio" end - it "has the correct hint_text" do - expect(question.hint_text).to eq "Sheltered housing and special retirement housing are for tenants with low-level care and support needs. This typically provides some limited support to enable independent living, such as alarm-based assistance or a scheme manager.

Extra care housing is for tenants with medium to high care and support needs, often with 24 hour access to support staff provided by an agency registered with the Care Quality Commission." - end - context "with 2023/24 form" do it "has the correct answer_options" do expect(question.answer_options).to eq({ diff --git a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb index 81d0b8b3b..66ea2b355 100644 --- a/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/starter_tenancy_type_spec.rb @@ -19,18 +19,6 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(false) end - it "has the correct check answer label" do - expect(question.check_answer_label).to eq("Type of main tenancy after the starter period has ended") - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is also known as an ‘introductory period’.") - end - - it "has the correct header" do - expect(question.header).to eq("What is the type of tenancy after the starter period has ended?") - end - it "has the correct answer options" do expect(question.answer_options).to eq( { @@ -65,18 +53,6 @@ RSpec.describe Form::Lettings::Questions::StarterTenancyType, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(true) end - it "has the correct check answer label" do - expect(question.check_answer_label).to eq("Type of main tenancy after the starter or introductory period has ended") - end - - it "has the correct updated hint_text" do - expect(question.hint_text).to eq("") - end - - it "has the correct header" do - expect(question.header).to eq("What is the type of tenancy after the starter or introductory period has ended?") - end - it "has the correct answer options" do expect(question.answer_options).to eq( { diff --git a/spec/models/form/lettings/questions/startertenancy_spec.rb b/spec/models/form/lettings/questions/startertenancy_spec.rb deleted file mode 100644 index f5b1e7ec5..000000000 --- a/spec/models/form/lettings/questions/startertenancy_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -require "rails_helper" - -RSpec.describe Form::Lettings::Questions::Startertenancy, type: :model do - subject(:question) { described_class.new(question_id, question_definition, page) } - - let(:question_id) { nil } - let(:question_definition) { nil } - let(:page) { instance_double(Form::Page) } - let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } - - before do - allow(page).to receive(:subsection).and_return(subsection) - allow(subsection).to receive(:form).and_return(form) - end - - context "with collection year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is also known as an ‘introductory period’.") - end - end - - context "with collection year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct updated hint_text" do - expect(question.hint_text).to eq("If the tenancy has an ‘introductory period’ answer ‘yes’.

- You should submit a CORE log at the beginning of the starter tenancy or introductory period, with the best information you have at the time. You do not need to submit a log when a tenant later rolls onto the main tenancy.") - end - end -end diff --git a/spec/models/form/lettings/questions/stock_owner_spec.rb b/spec/models/form/lettings/questions/stock_owner_spec.rb index 9f668b8e1..2ed817833 100644 --- a/spec/models/form/lettings/questions/stock_owner_spec.rb +++ b/spec/models/form/lettings/questions/stock_owner_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::StockOwner, type: :model do expect(question.id).to eq("owning_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation owns this property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Stock owner") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "answer options" do let(:options) { { "" => "Select an option" } } diff --git a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb index 45d2a80eb..fb334f909 100644 --- a/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_affordable_rent_spec.rb @@ -23,29 +23,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthAffordableRent, type: :mo expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the fixed-term tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of fixed-term tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs and you do not need a log for shorter tenancies.") - end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 2 years for social or affordable rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 2 years.") - end - end end diff --git a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb index 9599997fb..0c0923bf8 100644 --- a/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_intermediate_rent_spec.rb @@ -23,29 +23,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthIntermediateRent, type: : expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the fixed-term tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of fixed-term tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs and you do not need a log for shorter tenancies.") - end - - context "with collection year on or after 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.
The minimum period is 1 year for intermediate rent general needs logs. You do not need to submit CORE logs for these types of tenancies if they are shorter than 1 year.") - end - end end diff --git a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb index 4a2563e6f..3a0fae171 100644 --- a/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_periodic_spec.rb @@ -15,19 +15,7 @@ RSpec.describe Form::Lettings::Questions::TenancyLengthPeriodic, type: :model do expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the periodic tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of periodic tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("As this is a periodic tenancy, this question is optional. If you do not have the information available click save and continue") - end end diff --git a/spec/models/form/lettings/questions/tenancy_length_spec.rb b/spec/models/form/lettings/questions/tenancy_length_spec.rb index 4d1e9ec50..2d87d0923 100644 --- a/spec/models/form/lettings/questions/tenancy_length_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_length_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::TenancyLength, type: :model do expect(question.id).to eq("tenancylength") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the fixed-term tenancy to the nearest year?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of fixed-term tenancy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Do not include the starter or introductory period.") - end - it "has the correct minimum and maximum" do expect(question.min).to eq 0 expect(question.max).to eq 150 diff --git a/spec/models/form/lettings/questions/tenancy_other_spec.rb b/spec/models/form/lettings/questions/tenancy_other_spec.rb index 554948ff3..ce8aec5db 100644 --- a/spec/models/form/lettings/questions/tenancy_other_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_other_spec.rb @@ -13,22 +13,10 @@ RSpec.describe Form::Lettings::Questions::TenancyOther, type: :model do expect(question.id).to eq("tenancyother") end - it "has the correct header" do - expect(question.header).to eq("Please state the tenancy type") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("") - end - it "has the correct type" do expect(question.type).to eq("text") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "is not marked as derived" do expect(question.derived?(nil)).to be false end diff --git a/spec/models/form/lettings/questions/tenancy_start_date_spec.rb b/spec/models/form/lettings/questions/tenancy_start_date_spec.rb index 35083ad01..67a0464b4 100644 --- a/spec/models/form/lettings/questions/tenancy_start_date_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_start_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::TenancyStartDate, type: :model do expect(question.id).to eq("startdate") end - it "has the correct header" do - expect(question.header).to eq("What is the tenancy start date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Tenancy start date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/lettings/questions/tenancy_type_spec.rb b/spec/models/form/lettings/questions/tenancy_type_spec.rb index 196ec38bb..13998094a 100644 --- a/spec/models/form/lettings/questions/tenancy_type_spec.rb +++ b/spec/models/form/lettings/questions/tenancy_type_spec.rb @@ -21,22 +21,10 @@ RSpec.describe Form::Lettings::Questions::TenancyType, type: :model do expect(question.id).to eq("tenancy") end - it "has the correct header" do - expect(question.header).to eq("What is the type of tenancy?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of main tenancy") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "has the correct conditional_for" do expect(question.conditional_for).to eq({ "tenancyother" => [3] }) end diff --git a/spec/models/form/lettings/questions/tenant_code_spec.rb b/spec/models/form/lettings/questions/tenant_code_spec.rb index e5e434427..833ebf0ee 100644 --- a/spec/models/form/lettings/questions/tenant_code_spec.rb +++ b/spec/models/form/lettings/questions/tenant_code_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Lettings::Questions::TenantCode, type: :model do expect(question.id).to eq("tenancycode") end - it "has the correct header" do - expect(question.header).to eq("What is the tenant code?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Tenant code") - end - it "has the correct type" do expect(question.type).to eq("text") end - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is how you usually refer to this tenancy on your own systems.") - end - it "has the correct width" do expect(question.width).to eq(10) end diff --git a/spec/models/form/lettings/questions/town_or_city_spec.rb b/spec/models/form/lettings/questions/town_or_city_spec.rb index 77867630f..5dab9d637 100644 --- a/spec/models/form/lettings/questions/town_or_city_spec.rb +++ b/spec/models/form/lettings/questions/town_or_city_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::TownOrCity, type: :model do expect(question.id).to eq("town_or_city") end - it "has the correct header" do - expect(question.header).to eq("Town or city") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Town or city") - end - it "has the correct question_number" do expect(question.question_number).to eq(12) end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::TownOrCity, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/lettings/questions/uprn_confirmation_spec.rb b/spec/models/form/lettings/questions/uprn_confirmation_spec.rb index c0b6ef8a4..748f8979d 100644 --- a/spec/models/form/lettings/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/lettings/questions/uprn_confirmation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::UprnConfirmation, type: :model do expect(question.id).to eq("uprn_confirmed") end - it "has the correct header" do - expect(question.header).to eq("Is this the property address?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this the right address?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Lettings::Questions::UprnConfirmation, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must answer is this the right address?") end diff --git a/spec/models/form/lettings/questions/uprn_known_spec.rb b/spec/models/form/lettings/questions/uprn_known_spec.rb index 5f646e710..97a004f38 100644 --- a/spec/models/form/lettings/questions/uprn_known_spec.rb +++ b/spec/models/form/lettings/questions/uprn_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::UprnKnown, type: :model do expect(question.id).to eq("uprn_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -46,14 +38,6 @@ RSpec.describe Form::Lettings::Questions::UprnKnown, type: :model do expect(question.unanswered_error_message).to eq("You must answer UPRN known?") end - it "has the correct hint" do - expect(question.hint_text).to eq( - "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen.", - ) - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/lettings/questions/uprn_selection_spec.rb b/spec/models/form/lettings/questions/uprn_selection_spec.rb index 174aa017d..c3edc646e 100644 --- a/spec/models/form/lettings/questions/uprn_selection_spec.rb +++ b/spec/models/form/lettings/questions/uprn_selection_spec.rb @@ -32,14 +32,6 @@ RSpec.describe Form::Lettings::Questions::UprnSelection, type: :model do expect(question.id).to eq("uprn_selection") end - it "has the correct header" do - expect(question.header).to eq("Select the correct address") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Select the correct address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -52,10 +44,6 @@ RSpec.describe Form::Lettings::Questions::UprnSelection, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer options" do stub_request(:get, /api\.os\.uk/) .to_return(status: 200, body: "", headers: {}) diff --git a/spec/models/form/lettings/questions/uprn_spec.rb b/spec/models/form/lettings/questions/uprn_spec.rb index 7d4822c16..21f3e078b 100644 --- a/spec/models/form/lettings/questions/uprn_spec.rb +++ b/spec/models/form/lettings/questions/uprn_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::Uprn, type: :model do expect(question.id).to eq("uprn") end - it "has the correct header" do - expect(question.header).to eq("What is the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -35,10 +27,6 @@ RSpec.describe Form::Lettings::Questions::Uprn, type: :model do expect(question.question_number).to eq(11) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("UPRN must be 12 digits or less.") end diff --git a/spec/models/form/lettings/questions/voiddate_spec.rb b/spec/models/form/lettings/questions/voiddate_spec.rb index 75e33abbd..639501c42 100644 --- a/spec/models/form/lettings/questions/voiddate_spec.rb +++ b/spec/models/form/lettings/questions/voiddate_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Lettings::Questions::Voiddate, type: :model do expect(question.id).to eq("voiddate") end - it "has the correct header" do - expect(question.header).to eq("What is the void date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Void date") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/lettings/questions/waityear_spec.rb b/spec/models/form/lettings/questions/waityear_spec.rb index 5b30cd641..5f1f344b9 100644 --- a/spec/models/form/lettings/questions/waityear_spec.rb +++ b/spec/models/form/lettings/questions/waityear_spec.rb @@ -26,18 +26,10 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of time on local authority waiting list") - end - it "has the correct id" do expect(question.id).to eq("waityear") end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has correct conditional for" do expect(question.conditional_for).to be_nil end @@ -51,10 +43,6 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do end context "with 2023/24 form" do - it "has the correct header" do - expect(question.header).to eq("How long has the household been on the local authority waiting list for the new letting?") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Less than 1 year" }, @@ -74,10 +62,6 @@ RSpec.describe Form::Lettings::Questions::Waityear, type: :model do allow(form).to receive(:start_year_after_2024?).and_return(true) end - it "has the correct header" do - expect(question.header).to eq("How long has the household been on the local authority waiting list for the area of the new letting?") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Less than 1 year" }, diff --git a/spec/models/form/lettings/questions/wheelchair_spec.rb b/spec/models/form/lettings/questions/wheelchair_spec.rb index d24320788..984a2209f 100644 --- a/spec/models/form/lettings/questions/wheelchair_spec.rb +++ b/spec/models/form/lettings/questions/wheelchair_spec.rb @@ -19,22 +19,10 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do expect(question.id).to eq("wchair") end - it "has the correct header" do - expect(question.header).to eq("Is the property built or adapted to wheelchair-user standards?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property built or adapted to wheelchair-user standards") - end - it "has the correct type" do expect(question.type).to eq("radio") end - it "has the correct hint_text" do - expect(question.hint_text).to eq "" - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, @@ -45,14 +33,4 @@ RSpec.describe Form::Lettings::Questions::Wheelchair, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - context "with 2024 form" do - before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq "This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property." - end - end end diff --git a/spec/models/form/page_spec.rb b/spec/models/form/page_spec.rb index c66c0eca8..9315fb237 100644 --- a/spec/models/form/page_spec.rb +++ b/spec/models/form/page_spec.rb @@ -8,8 +8,8 @@ RSpec.describe Form::Page, type: :model do let(:depends_on) { nil } let(:enabled) { true } let(:depends_on_met) { true } - let(:form) { instance_double(Form, depends_on_met:) } - let(:subsection) { instance_double(Form::Subsection, depends_on:, enabled?: enabled, form:) } + let(:form) { instance_double(Form, depends_on_met:, type: "form-type", start_date: Time.utc(2024, 12, 25)) } + let(:subsection) { instance_double(Form::Subsection, depends_on:, enabled?: enabled, form:, id: "subsection-id") } let(:page_id) { "net_income" } let(:questions) { [["earnings", { "conditional_for" => { "age1": nil }, "type" => "radio" }], %w[incfreq]] } let(:page_definition) do @@ -24,6 +24,39 @@ RSpec.describe Form::Page, type: :model do expect(page.id).to eq(page_id) end + it "sets copy_key in the default style" do + expect(page.copy_key).to eq("#{form.type}.#{subsection.id}.#{questions[0][0]}") + end + + context "when header is not provided" do + let(:page_definition) do + { + "questions" => questions, + } + end + + context "and translation is present" do + before do + allow(I18n).to receive(:t).and_return("page header copy") + allow(I18n).to receive(:exists?).and_return(true) + end + + it "uses header from translations" do + expect(page.header).to eq("page header copy") + end + end + + context "and translation is not present" do + before do + allow(I18n).to receive(:exists?).and_return(false) + end + + it "uses empty header" do + expect(page.header).to eq("") + end + end + end + it "has a header" do expect(page.header).to eq("Test header") end diff --git a/spec/models/form/question_spec.rb b/spec/models/form/question_spec.rb index 6129f46ad..651d167bd 100644 --- a/spec/models/form/question_spec.rb +++ b/spec/models/form/question_spec.rb @@ -14,8 +14,8 @@ RSpec.describe Form::Question, type: :model do let(:answer_options) { { "1" => { "value" => "Weekly" }, "2" => { "value" => "Monthly" } } } let(:inferred_check_answers_value) { [{ "condition" => { "postcode_known" => 0 }, "value" => "Weekly" }] } - let(:form) { instance_double(Form, depends_on_met:, conditional_question_conditions:) } - let(:subsection) { instance_double(Form::Subsection, form:) } + let(:form) { instance_double(Form, depends_on_met:, conditional_question_conditions:, type: "form-type", start_date: Time.utc(2024, 12, 25)) } + let(:subsection) { instance_double(Form::Subsection, form:, id: "subsection-id") } let(:page) { instance_double(Form::Page, subsection:, routed_to?: true, questions: form_questions) } let(:question_id) { "earnings" } let(:question_definition) do @@ -38,6 +38,67 @@ RSpec.describe Form::Question, type: :model do expect(question.id).to eq(question_id) end + it "sets copy_key in the default style" do + expect(question.copy_key).to eq("#{form.type}.#{subsection.id}.#{question_id}") + end + + context "when copy is not provided" do + let(:question_definition) do + { + "type" => type, + "min" => 0, + "step" => 1, + "answer_options" => answer_options, + "readonly" => readonly, + "result-field" => "tcharge", + "fields-to-add" => %w[brent scharge pscharge supcharg], + "inferred_check_answers_value" => inferred_check_answers_value, + "suffix" => suffix, + "prefix" => prefix, + "hidden_in_check_answers" => {}, + } + end + + context "and translations are present" do + before do + allow(I18n).to receive(:t).with("forms.#{form.start_date.year}.#{question.copy_key}.question_text", { default: "" }).and_return("header copy") + allow(I18n).to receive(:t).with("forms.#{form.start_date.year}.#{question.copy_key}.check_answer_label", { default: "" }).and_return("check answer label copy") + allow(I18n).to receive(:t).with("forms.#{form.start_date.year}.#{question.copy_key}.hint_text", { default: "" }).and_return("hint text copy") + allow(I18n).to receive(:exists?).and_return(true) + end + + it "uses header from translations" do + expect(question.header).to eq("header copy") + end + + it "uses check answer label from translations" do + expect(question.check_answer_label).to eq("check answer label copy") + end + + it "uses hint text from translations" do + expect(question.hint_text).to eq("hint text copy") + end + end + + context "and translations are not present" do + before do + allow(I18n).to receive(:exists?).and_return(false) + end + + it "uses empty header" do + expect(question.header).to eq("") + end + + it "uses empty check answer label" do + expect(question.check_answer_label).to eq("") + end + + it "uses empty hint text" do + expect(question.hint_text).to eq("") + end + end + end + it "has a header" do expect(question.header).to eq("What is the tenant’s /and partner’s combined income after tax?") end diff --git a/spec/models/form/sales/pages/about_price_value_check_spec.rb b/spec/models/form/sales/pages/about_price_value_check_spec.rb index 7b7099681..7d3c31537 100644 --- a/spec/models/form/sales/pages/about_price_value_check_spec.rb +++ b/spec/models/form/sales/pages/about_price_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::AboutPriceValueCheck, type: :model do expect(page.id).to eq("savings_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "purchase_price_out_of_soft_range?" => true }]) end diff --git a/spec/models/form/sales/pages/about_staircase_spec.rb b/spec/models/form/sales/pages/about_staircase_spec.rb index 48aa82acf..181c3f695 100644 --- a/spec/models/form/sales/pages/about_staircase_spec.rb +++ b/spec/models/form/sales/pages/about_staircase_spec.rb @@ -36,10 +36,6 @@ RSpec.describe Form::Sales::Pages::AboutStaircase, type: :model do expect(page.id).to eq("an_id") end - it "has the correct header" do - expect(page.header).to eq("About the staircasing transaction") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/address_fallback_spec.rb b/spec/models/form/sales/pages/address_fallback_spec.rb index 395ac1a1b..4c48a46fe 100644 --- a/spec/models/form/sales/pages/address_fallback_spec.rb +++ b/spec/models/form/sales/pages/address_fallback_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::AddressFallback, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q12 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/address_matcher_spec.rb b/spec/models/form/sales/pages/address_matcher_spec.rb index 6d6a4174f..a0f1e1413 100644 --- a/spec/models/form/sales/pages/address_matcher_spec.rb +++ b/spec/models/form/sales/pages/address_matcher_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::AddressMatcher, type: :model do expect(page.id).to eq("address_matcher") end - it "has the correct header" do - expect(page.header).to eq("Find an address") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/address_spec.rb b/spec/models/form/sales/pages/address_spec.rb index 445ef6220..a4ce72371 100644 --- a/spec/models/form/sales/pages/address_spec.rb +++ b/spec/models/form/sales/pages/address_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Address, type: :model do expect(page.id).to eq("address") end - it "has the correct header" do - expect(page.header).to eq("Q15 - What is the property's address?") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/age1_spec.rb b/spec/models/form/sales/pages/age1_spec.rb index 227894146..fc4b87880 100644 --- a/spec/models/form/sales/pages/age1_spec.rb +++ b/spec/models/form/sales/pages/age1_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Age1, type: :model do expect(page.id).to eq("buyer_1_age") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/age2_spec.rb b/spec/models/form/sales/pages/age2_spec.rb index 3e18392bf..f324c8ad2 100644 --- a/spec/models/form/sales/pages/age2_spec.rb +++ b/spec/models/form/sales/pages/age2_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Age2, type: :model do expect(page.id).to eq("buyer_2_age") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/armed_forces_spec.rb b/spec/models/form/sales/pages/armed_forces_spec.rb index 2d90c4621..de8c7a9a2 100644 --- a/spec/models/form/sales/pages/armed_forces_spec.rb +++ b/spec/models/form/sales/pages/armed_forces_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ArmedForces, type: :model do expect(page.id).to eq("armed_forces") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/armed_forces_spouse_spec.rb b/spec/models/form/sales/pages/armed_forces_spouse_spec.rb index 6c99fc581..d31a1fe60 100644 --- a/spec/models/form/sales/pages/armed_forces_spouse_spec.rb +++ b/spec/models/form/sales/pages/armed_forces_spouse_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ArmedForcesSpouse, type: :model do expect(page.id).to eq("armed_forces_spouse") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb index 58f8672be..68328a5db 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_arab_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundArab, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_arab") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb index ad004b5b1..b4c8a198d 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_asian_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundAsian, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_asian") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb index 0192daf72..7650f49fa 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_black_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundBlack, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_black") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb index 84f3bf761..42420774f 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_mixed_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundMixed, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_mixed") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb index 7c1a91bf1..79dddc53a 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_background_white_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicBackgroundWhite, type: :model do expect(page.id).to eq("buyer_1_ethnic_background_white") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb index 9560aa272..dcc90fe51 100644 --- a/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/pages/buyer1_ethnic_group_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1EthnicGroup, type: :model do expect(page.id).to eq("buyer_1_ethnic_group") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb b/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb index e1f21c6d6..48e921468 100644 --- a/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer1_income_max_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1IncomeMaxValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_1_income_max_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb b/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb index cf47f7420..1736daef7 100644 --- a/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer1_income_min_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1IncomeMinValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_1_income_min_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer1_income_spec.rb b/spec/models/form/sales/pages/buyer1_income_spec.rb index c339bc142..119a6e2f6 100644 --- a/spec/models/form/sales/pages/buyer1_income_spec.rb +++ b/spec/models/form/sales/pages/buyer1_income_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1Income, type: :model do expect(page.id).to eq("buyer_1_income") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb index 7414d93e1..2f3c92aa7 100644 --- a/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/pages/buyer1_live_in_property_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1LiveInProperty, type: :model do expect(page.id).to eq("buyer_1_live_in_property") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_mortgage_spec.rb b/spec/models/form/sales/pages/buyer1_mortgage_spec.rb index be66b9446..cb0e23319 100644 --- a/spec/models/form/sales/pages/buyer1_mortgage_spec.rb +++ b/spec/models/form/sales/pages/buyer1_mortgage_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer1Mortgage, type: :model do expect(page.id).to eq("buyer_1_mortgage") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_nationality_spec.rb b/spec/models/form/sales/pages/buyer1_nationality_spec.rb index 77a8c966e..a9cb1e381 100644 --- a/spec/models/form/sales/pages/buyer1_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer1_nationality_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::Buyer1Nationality, type: :model do expect(page.id).to eq "buyer_1_nationality" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb b/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb index 0af602b0d..51379136e 100644 --- a/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb +++ b/spec/models/form/sales/pages/buyer1_previous_tenure_spec.rb @@ -16,8 +16,4 @@ RSpec.describe Form::Sales::Pages::Buyer1PreviousTenure, type: :model do it "has the correct id" do expect(page.id).to eq("buyer1_previous_tenure") end - - it "has the correct header" do - expect(page.header).to be_nil - end end diff --git a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb index f9d833abf..2ae7f0f1e 100644 --- a/spec/models/form/sales/pages/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer1_working_situation_spec.rb @@ -18,8 +18,4 @@ RSpec.describe Form::Sales::Pages::Buyer1WorkingSituation, type: :model do it "has the correct id" do expect(page.id).to eq("buyer_1_working_situation") end - - it "has the correct header" do - expect(page.header).to be_nil - end end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb index 2d1509564..1927d728e 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_arab_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundArab, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_arab") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb index 431204ce5..af17bcaf3 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_asian_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundAsian, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_asian") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb index 512075579..6d3d2aa19 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_black_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundBlack, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_black") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb index e57078caa..3eef3c5bb 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_mixed_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundMixed, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_mixed") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb index dd87bf707..0750c78c8 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_background_white_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicBackgroundWhite, type: :model do expect(page.id).to eq("buyer_2_ethnic_background_white") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb b/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb index 7760124e8..d129508ee 100644 --- a/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb +++ b/spec/models/form/sales/pages/buyer2_ethnic_group_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2EthnicGroup, type: :model do expect(page.id).to eq("buyer_2_ethnic_group") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb b/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb index af9ffd88c..440a6bb13 100644 --- a/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer2_income_max_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2IncomeMaxValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_2_income_max_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb b/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb index fb13de21b..887dcab29 100644 --- a/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer2_income_min_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2IncomeMinValueCheck, type: :model do expect(page.id).to eq("prefix_buyer_2_income_min_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer2_income_spec.rb b/spec/models/form/sales/pages/buyer2_income_spec.rb index dc08418f2..e77092d55 100644 --- a/spec/models/form/sales/pages/buyer2_income_spec.rb +++ b/spec/models/form/sales/pages/buyer2_income_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2Income, type: :model do expect(page.id).to eq("buyer_2_income") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb b/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb index be5cf65dd..b2eb2386b 100644 --- a/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb +++ b/spec/models/form/sales/pages/buyer2_live_in_property_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2LiveInProperty, type: :model do expect(page.id).to eq("buyer_2_live_in_property") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_living_in_spec.rb b/spec/models/form/sales/pages/buyer2_living_in_spec.rb index f76253a12..972576ab7 100644 --- a/spec/models/form/sales/pages/buyer2_living_in_spec.rb +++ b/spec/models/form/sales/pages/buyer2_living_in_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Sales::Pages::Buyer2LivingIn, type: :model do expect(page.id).to eq("buyer_2_living_in") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_mortgage_spec.rb b/spec/models/form/sales/pages/buyer2_mortgage_spec.rb index d5bd4549b..be342f60f 100644 --- a/spec/models/form/sales/pages/buyer2_mortgage_spec.rb +++ b/spec/models/form/sales/pages/buyer2_mortgage_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2Mortgage, type: :model do expect(page.id).to eq("buyer_2_mortgage") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_nationality_spec.rb b/spec/models/form/sales/pages/buyer2_nationality_spec.rb index 691ba40c3..97b5f7caf 100644 --- a/spec/models/form/sales/pages/buyer2_nationality_spec.rb +++ b/spec/models/form/sales/pages/buyer2_nationality_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::Buyer2Nationality, type: :model do expect(page.id).to eq "buyer_2_nationality" end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb b/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb index 5c6993daa..37feb8e4f 100644 --- a/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer2_previous_housing_situation_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Sales::Pages::Buyer2PreviousHousingSituation, type: :model expect(page.id).to eq("buyer_2_previous_housing_situation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb index 4a7745bb0..96a67f5bf 100644 --- a/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/buyer2_relationship_to_buyer1_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2RelationshipToBuyer1, type: :model do expect(page.id).to eq("buyer_2_relationship_to_buyer_1") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer2_working_situation_spec.rb b/spec/models/form/sales/pages/buyer2_working_situation_spec.rb index 3473308e5..0b7708303 100644 --- a/spec/models/form/sales/pages/buyer2_working_situation_spec.rb +++ b/spec/models/form/sales/pages/buyer2_working_situation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Buyer2WorkingSituation, type: :model do expect(page.id).to eq("buyer_2_working_situation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_company_spec.rb b/spec/models/form/sales/pages/buyer_company_spec.rb index 6f26a731c..83cca76a4 100644 --- a/spec/models/form/sales/pages/buyer_company_spec.rb +++ b/spec/models/form/sales/pages/buyer_company_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::BuyerCompany, type: :model do expect(page.id).to eq("buyer_company") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_interview_spec.rb b/spec/models/form/sales/pages/buyer_interview_spec.rb index 73191593c..ce72974e9 100644 --- a/spec/models/form/sales/pages/buyer_interview_spec.rb +++ b/spec/models/form/sales/pages/buyer_interview_spec.rb @@ -19,11 +19,23 @@ RSpec.describe Form::Sales::Pages::BuyerInterview, type: :model do expect(page.id).to eq("buyer_interview") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end + + context "when there are joint buyers" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.noint.joint_purchase") + end + end + + context "when there is a single buyer" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } + + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.noint.not_joint_purchase") + end + end end diff --git a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb index 22d1433bc..4bce29312 100644 --- a/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_in_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::BuyerLiveInValueCheck, type: :model do expect(page.id).to eq("buyer_1_live_in_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/buyer_live_spec.rb b/spec/models/form/sales/pages/buyer_live_spec.rb index c46908dff..dd237214c 100644 --- a/spec/models/form/sales/pages/buyer_live_spec.rb +++ b/spec/models/form/sales/pages/buyer_live_spec.rb @@ -1,15 +1,17 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::BuyerLive, type: :model do + include CollectionTimeHelper + subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } let(:page_definition) { nil } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_after_2024?).and_return(true) allow(subsection).to receive(:form).and_return(form) end @@ -25,10 +27,6 @@ RSpec.describe Form::Sales::Pages::BuyerLive, type: :model do expect(page.id).to eq("buyer_live") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_previous_spec.rb b/spec/models/form/sales/pages/buyer_previous_spec.rb index d66c67cc6..d55243dec 100644 --- a/spec/models/form/sales/pages/buyer_previous_spec.rb +++ b/spec/models/form/sales/pages/buyer_previous_spec.rb @@ -24,10 +24,6 @@ RSpec.describe Form::Sales::Pages::BuyerPrevious, type: :model do expect(page.id).to eq("example") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyer_still_serving_spec.rb b/spec/models/form/sales/pages/buyer_still_serving_spec.rb index 328e364f9..af000539d 100644 --- a/spec/models/form/sales/pages/buyer_still_serving_spec.rb +++ b/spec/models/form/sales/pages/buyer_still_serving_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::BuyerStillServing, type: :model do expect(page.id).to eq("buyer_still_serving") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/buyers_organisations_spec.rb b/spec/models/form/sales/pages/buyers_organisations_spec.rb index 603dd09ae..86527a0f8 100644 --- a/spec/models/form/sales/pages/buyers_organisations_spec.rb +++ b/spec/models/form/sales/pages/buyers_organisations_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::BuyersOrganisations, type: :model do expect(page.id).to eq("buyers_organisations") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb b/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb index c9834e042..c79cb38da 100644 --- a/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb +++ b/spec/models/form/sales/pages/combined_income_max_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::CombinedIncomeMaxValueCheck, type: :model do expect(page.id).to eq("prefix_combined_income_max_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/created_by_spec.rb b/spec/models/form/sales/pages/created_by_spec.rb index feb7489e2..7d9a25018 100644 --- a/spec/models/form/sales/pages/created_by_spec.rb +++ b/spec/models/form/sales/pages/created_by_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Form::Sales::Pages::CreatedBy, type: :model do let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection) } + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2024, 4, 1))) } let(:form) { instance_double(Form) } let(:lettings_log) { instance_double(LettingsLog) } @@ -21,10 +21,6 @@ RSpec.describe Form::Sales::Pages::CreatedBy, type: :model do expect(page.id).to eq("assigned_to") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/deposit_discount_spec.rb b/spec/models/form/sales/pages/deposit_discount_spec.rb index f4ffb85e5..d183e379b 100644 --- a/spec/models/form/sales/pages/deposit_discount_spec.rb +++ b/spec/models/form/sales/pages/deposit_discount_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::DepositDiscount, type: :model do expect(page.id).to eq("discount") end - it "has the correct header" do - expect(page.header).to eq("About the deposit") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/deposit_spec.rb b/spec/models/form/sales/pages/deposit_spec.rb index 3a3746ac6..b33604176 100644 --- a/spec/models/form/sales/pages/deposit_spec.rb +++ b/spec/models/form/sales/pages/deposit_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::Deposit, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to eq("About the deposit") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/deposit_value_check_spec.rb b/spec/models/form/sales/pages/deposit_value_check_spec.rb index 026102ef4..5c4cd3608 100644 --- a/spec/models/form/sales/pages/deposit_value_check_spec.rb +++ b/spec/models/form/sales/pages/deposit_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::DepositValueCheck, type: :model do expect(page.id).to eq("deposit_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/discount_spec.rb b/spec/models/form/sales/pages/discount_spec.rb index 1a38bd634..4585b7f19 100644 --- a/spec/models/form/sales/pages/discount_spec.rb +++ b/spec/models/form/sales/pages/discount_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::Discount, type: :model do expect(page.id).to eq("discount") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/discounted_ownership_type_spec.rb b/spec/models/form/sales/pages/discounted_ownership_type_spec.rb index 708090420..afb4d2757 100644 --- a/spec/models/form/sales/pages/discounted_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/discounted_ownership_type_spec.rb @@ -8,24 +8,6 @@ RSpec.describe Form::Sales::Pages::DiscountedOwnershipType, type: :model do let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date:)) } let(:start_date) { Time.zone.today } - describe "headers" do - context "when form year is for 2023/24" do - let(:start_date) { Time.zone.local(2023, 4, 8) } - - it "has the correct header" do - expect(page.header).to eq("Type of discounted ownership sale") - end - end - - context "when form year is for before 2023/24" do - let(:start_date) { Time.zone.local(2022, 2, 8) } - - it "does not have a page header" do - expect(page.header).to eq(nil) - end - end - end - it "has correct subsection" do expect(page.subsection).to eq(subsection) end diff --git a/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb b/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb index ce0d7be8e..38a5f69ae 100644 --- a/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb +++ b/spec/models/form/sales/pages/discounted_sale_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::DiscountedSaleValueCheck, type: :model do expect(page.id).to eq("discounted_sale_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.discounted_sale_value.title_text", diff --git a/spec/models/form/sales/pages/equity_spec.rb b/spec/models/form/sales/pages/equity_spec.rb index bf620269e..a44085101 100644 --- a/spec/models/form/sales/pages/equity_spec.rb +++ b/spec/models/form/sales/pages/equity_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Equity, type: :model do expect(page.id).to eq("equity") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/exchange_date_spec.rb b/spec/models/form/sales/pages/exchange_date_spec.rb index 979e8634b..3496b17f6 100644 --- a/spec/models/form/sales/pages/exchange_date_spec.rb +++ b/spec/models/form/sales/pages/exchange_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ExchangeDate, type: :model do expect(page.id).to eq("exchange_contracts") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/extra_borrowing_spec.rb b/spec/models/form/sales/pages/extra_borrowing_spec.rb index 609abdb64..eb719c295 100644 --- a/spec/models/form/sales/pages/extra_borrowing_spec.rb +++ b/spec/models/form/sales/pages/extra_borrowing_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ExtraBorrowing, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/gender_identity1_spec.rb b/spec/models/form/sales/pages/gender_identity1_spec.rb index da0e3f07a..69bd79e04 100644 --- a/spec/models/form/sales/pages/gender_identity1_spec.rb +++ b/spec/models/form/sales/pages/gender_identity1_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::GenderIdentity1, type: :model do expect(page.id).to eq("buyer_1_gender_identity") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/gender_identity2_spec.rb b/spec/models/form/sales/pages/gender_identity2_spec.rb index f011ec215..8d9866244 100644 --- a/spec/models/form/sales/pages/gender_identity2_spec.rb +++ b/spec/models/form/sales/pages/gender_identity2_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::GenderIdentity2, type: :model do expect(page.id).to eq("buyer_2_gender_identity") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/grant_spec.rb b/spec/models/form/sales/pages/grant_spec.rb index f88cdf9ae..1b7dd1873 100644 --- a/spec/models/form/sales/pages/grant_spec.rb +++ b/spec/models/form/sales/pages/grant_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Grant, type: :model do expect(page.id).to eq("grant") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/handover_date_check_spec.rb b/spec/models/form/sales/pages/handover_date_check_spec.rb index 9f60fa20f..f245675d5 100644 --- a/spec/models/form/sales/pages/handover_date_check_spec.rb +++ b/spec/models/form/sales/pages/handover_date_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HandoverDateCheck, type: :model do expect(page.id).to eq("handover_date_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.hodate.must_be_less_than_3_years_from_saledate", diff --git a/spec/models/form/sales/pages/handover_date_spec.rb b/spec/models/form/sales/pages/handover_date_spec.rb index c213959b2..1acc35fbc 100644 --- a/spec/models/form/sales/pages/handover_date_spec.rb +++ b/spec/models/form/sales/pages/handover_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HandoverDate, type: :model do expect(page.id).to eq("handover_date") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/household_disability_spec.rb b/spec/models/form/sales/pages/household_disability_spec.rb index edc8571b7..193ba7f40 100644 --- a/spec/models/form/sales/pages/household_disability_spec.rb +++ b/spec/models/form/sales/pages/household_disability_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HouseholdDisability, type: :model do expect(page.id).to eq("household_disability") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/household_wheelchair_check_spec.rb b/spec/models/form/sales/pages/household_wheelchair_check_spec.rb index 20d0a325f..f0789b54c 100644 --- a/spec/models/form/sales/pages/household_wheelchair_check_spec.rb +++ b/spec/models/form/sales/pages/household_wheelchair_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HouseholdWheelchairCheck, type: :model do expect(page.id).to eq("buyer_1_income_mortgage_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/household_wheelchair_spec.rb b/spec/models/form/sales/pages/household_wheelchair_spec.rb index 5c5c0c48c..128ba632f 100644 --- a/spec/models/form/sales/pages/household_wheelchair_spec.rb +++ b/spec/models/form/sales/pages/household_wheelchair_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::HouseholdWheelchair, type: :model do expect(page.id).to eq("household_wheelchair") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/housing_benefits_spec.rb b/spec/models/form/sales/pages/housing_benefits_spec.rb index 455f62a0e..c8565f8d7 100644 --- a/spec/models/form/sales/pages/housing_benefits_spec.rb +++ b/spec/models/form/sales/pages/housing_benefits_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::HousingBenefits, type: :model do expect(page.id).to eq(page_id) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/joint_purchase_spec.rb b/spec/models/form/sales/pages/joint_purchase_spec.rb index 6c0f6a4f5..4ccefd03d 100644 --- a/spec/models/form/sales/pages/joint_purchase_spec.rb +++ b/spec/models/form/sales/pages/joint_purchase_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::JointPurchase, type: :model do expect(page.id).to eq("joint_purchase") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/la_nominations_spec.rb b/spec/models/form/sales/pages/la_nominations_spec.rb index 5f403c3e2..b69f88f1f 100644 --- a/spec/models/form/sales/pages/la_nominations_spec.rb +++ b/spec/models/form/sales/pages/la_nominations_spec.rb @@ -27,10 +27,6 @@ RSpec.describe Form::Sales::Pages::LaNominations, type: :model do expect(page.id).to eq("la_nominations") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/last_accommodation_la_spec.rb b/spec/models/form/sales/pages/last_accommodation_la_spec.rb index a0dfff50e..b73cf07f0 100644 --- a/spec/models/form/sales/pages/last_accommodation_la_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_la_spec.rb @@ -22,10 +22,6 @@ RSpec.describe Form::Sales::Pages::LastAccommodationLa, type: :model do expect(page.id).to eq("last_accommodation_la") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/last_accommodation_spec.rb b/spec/models/form/sales/pages/last_accommodation_spec.rb index 094c99282..8c3dbdbbf 100644 --- a/spec/models/form/sales/pages/last_accommodation_spec.rb +++ b/spec/models/form/sales/pages/last_accommodation_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::LastAccommodation, type: :model do expect(page.id).to eq("last_accommodation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/leasehold_charges_spec.rb b/spec/models/form/sales/pages/leasehold_charges_spec.rb index a3f2afa53..b03920d3f 100644 --- a/spec/models/form/sales/pages/leasehold_charges_spec.rb +++ b/spec/models/form/sales/pages/leasehold_charges_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::LeaseholdCharges, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/living_before_purchase_spec.rb b/spec/models/form/sales/pages/living_before_purchase_spec.rb index d12cff216..26026471b 100644 --- a/spec/models/form/sales/pages/living_before_purchase_spec.rb +++ b/spec/models/form/sales/pages/living_before_purchase_spec.rb @@ -35,10 +35,6 @@ RSpec.describe Form::Sales::Pages::LivingBeforePurchase, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/managing_organisation_spec.rb b/spec/models/form/sales/pages/managing_organisation_spec.rb index aacb7cccb..ea90add64 100644 --- a/spec/models/form/sales/pages/managing_organisation_spec.rb +++ b/spec/models/form/sales/pages/managing_organisation_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::ManagingOrganisation, type: :model do expect(page.id).to eq("managing_organisation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb index 5add5d8e7..cb187ecfd 100644 --- a/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb +++ b/spec/models/form/sales/pages/monthly_charges_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MonthlyChargesValueCheck, type: :model do expect(page.id).to eq("monthly_charges_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/monthly_rent_spec.rb b/spec/models/form/sales/pages/monthly_rent_spec.rb index 0710f6280..b9e5abe11 100644 --- a/spec/models/form/sales/pages/monthly_rent_spec.rb +++ b/spec/models/form/sales/pages/monthly_rent_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MonthlyRent, type: :model do expect(page.id).to eq("monthly_rent") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/mortgage_amount_spec.rb b/spec/models/form/sales/pages/mortgage_amount_spec.rb index 9400ede28..a6298f1e8 100644 --- a/spec/models/form/sales/pages/mortgage_amount_spec.rb +++ b/spec/models/form/sales/pages/mortgage_amount_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageAmount, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to eq("Mortgage Amount") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/mortgage_lender_other_spec.rb b/spec/models/form/sales/pages/mortgage_lender_other_spec.rb index 93ef4d342..c5effa912 100644 --- a/spec/models/form/sales/pages/mortgage_lender_other_spec.rb +++ b/spec/models/form/sales/pages/mortgage_lender_other_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageLenderOther, type: :model do expect(page.id).to eq("mortgage_lender_other") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/mortgage_lender_spec.rb b/spec/models/form/sales/pages/mortgage_lender_spec.rb index e0f645d9b..2fac00350 100644 --- a/spec/models/form/sales/pages/mortgage_lender_spec.rb +++ b/spec/models/form/sales/pages/mortgage_lender_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageLender, type: :model do expect(page.id).to eq("mortgage_lender") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/mortgage_length_spec.rb b/spec/models/form/sales/pages/mortgage_length_spec.rb index f5d718f5c..7e1ab9f26 100644 --- a/spec/models/form/sales/pages/mortgage_length_spec.rb +++ b/spec/models/form/sales/pages/mortgage_length_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::MortgageLength, type: :model do expect(page.id).to eq(nil) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/mortgage_value_check_spec.rb b/spec/models/form/sales/pages/mortgage_value_check_spec.rb index f33525652..e4dc11bbc 100644 --- a/spec/models/form/sales/pages/mortgage_value_check_spec.rb +++ b/spec/models/form/sales/pages/mortgage_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::MortgageValueCheck, type: :model do expect(page.id).to eq("buyer_1_income_mortgage_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "is interruption screen page" do expect(page.interruption_screen?).to eq(true) end diff --git a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb index 57d8c2771..890a24e6a 100644 --- a/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb +++ b/spec/models/form/sales/pages/multiple_partners_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::MultiplePartnersValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/no_address_found_spec.rb b/spec/models/form/sales/pages/no_address_found_spec.rb index 79b2bd0ca..1a40abba4 100644 --- a/spec/models/form/sales/pages/no_address_found_spec.rb +++ b/spec/models/form/sales/pages/no_address_found_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::NoAddressFound, type: :model do expect(page.id).to eq("no_address_found") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "address_options_present?" => false, "uprn_known" => nil }, { "address_options_present?" => false, "uprn_known" => 0 }, diff --git a/spec/models/form/sales/pages/number_joint_buyers_spec.rb b/spec/models/form/sales/pages/number_joint_buyers_spec.rb index c48fc654b..50bbd7c5f 100644 --- a/spec/models/form/sales/pages/number_joint_buyers_spec.rb +++ b/spec/models/form/sales/pages/number_joint_buyers_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::NumberJointBuyers, type: :model do expect(page.id).to eq("number_joint_buyers") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/number_of_others_in_property_spec.rb b/spec/models/form/sales/pages/number_of_others_in_property_spec.rb index 197f04e67..859aff8e0 100644 --- a/spec/models/form/sales/pages/number_of_others_in_property_spec.rb +++ b/spec/models/form/sales/pages/number_of_others_in_property_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::NumberOfOthersInProperty, type: :model do expect(page.id).to eq("number_of_others_in_property") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb index fce6a5e69..8bc20cef7 100644 --- a/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb +++ b/spec/models/form/sales/pages/old_persons_shared_ownership_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::OldPersonsSharedOwnershipValueCheck, type: :m expect(page.id).to eq("old_persons_shared_ownership_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/outright_ownership_type_spec.rb b/spec/models/form/sales/pages/outright_ownership_type_spec.rb index a080d148d..b308f23f1 100644 --- a/spec/models/form/sales/pages/outright_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/outright_ownership_type_spec.rb @@ -29,22 +29,4 @@ RSpec.describe Form::Sales::Pages::OutrightOwnershipType, type: :model do "ownershipsch" => 3, }]) end - - describe "headers" do - context "when the form year is 2023/24" do - let(:start_date) { Time.zone.local(2023, 4, 8) } - - it "has the correct header" do - expect(page.header).to eq("Type of outright sale") - end - end - - context "when the form is before the year 2023/24" do - let(:start_date) { Time.zone.local(2022, 4, 8) } - - it "does not have a page header" do - expect(page.header).to eq(nil) - end - end - end end diff --git a/spec/models/form/sales/pages/ownership_scheme_spec.rb b/spec/models/form/sales/pages/ownership_scheme_spec.rb index 5e970be8a..b9f3c5ae9 100644 --- a/spec/models/form/sales/pages/ownership_scheme_spec.rb +++ b/spec/models/form/sales/pages/ownership_scheme_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::OwnershipScheme, type: :model do expect(page.id).to eq("ownership_scheme") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/owning_organisation_spec.rb b/spec/models/form/sales/pages/owning_organisation_spec.rb index 8ed90ca93..3a9f1a900 100644 --- a/spec/models/form/sales/pages/owning_organisation_spec.rb +++ b/spec/models/form/sales/pages/owning_organisation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::OwningOrganisation, type: :model do expect(page.id).to eq("owning_organisation") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb index 7535d89ca..fe11bdc86 100644 --- a/spec/models/form/sales/pages/partner_under16_value_check_spec.rb +++ b/spec/models/form/sales/pages/partner_under16_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PartnerUnder16ValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb index 6b1fc36a4..5fc3e05ad 100644 --- a/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb +++ b/spec/models/form/sales/pages/percentage_discount_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PercentageDiscountValueCheck, type: :model do expect(page.id).to eq("percentage_discount_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.percentage_discount_value.title_text", diff --git a/spec/models/form/sales/pages/person_age_spec.rb b/spec/models/form/sales/pages/person_age_spec.rb index a6ee73e96..0cd79bd02 100644 --- a/spec/models/form/sales/pages/person_age_spec.rb +++ b/spec/models/form/sales/pages/person_age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Sales::Pages::PersonAge, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_gender_identity_spec.rb b/spec/models/form/sales/pages/person_gender_identity_spec.rb index 05a1fe0be..9d7eff2f1 100644 --- a/spec/models/form/sales/pages/person_gender_identity_spec.rb +++ b/spec/models/form/sales/pages/person_gender_identity_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonGenderIdentity, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_known_spec.rb b/spec/models/form/sales/pages/person_known_spec.rb index 82f461f44..141473138 100644 --- a/spec/models/form/sales/pages/person_known_spec.rb +++ b/spec/models/form/sales/pages/person_known_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonKnown, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb index 0fb5503ce..126f2f0b5 100644 --- a/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/pages/person_relationship_to_buyer1_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonRelationshipToBuyer1, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb index c0d1b2734..9185f9f1c 100644 --- a/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb +++ b/spec/models/form/sales/pages/person_student_not_child_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonStudentNotChildValueCheck, type: :model expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/person_working_situation_spec.rb b/spec/models/form/sales/pages/person_working_situation_spec.rb index 9400274f7..53c127e16 100644 --- a/spec/models/form/sales/pages/person_working_situation_spec.rb +++ b/spec/models/form/sales/pages/person_working_situation_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::PersonWorkingSituation, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/postcode_spec.rb b/spec/models/form/sales/pages/postcode_spec.rb index 485411414..8f9c7273c 100644 --- a/spec/models/form/sales/pages/postcode_spec.rb +++ b/spec/models/form/sales/pages/postcode_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Postcode, type: :model do expect(page.id).to eq("property_postcode") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_bedrooms_spec.rb b/spec/models/form/sales/pages/previous_bedrooms_spec.rb index ba9effe69..1899b03bc 100644 --- a/spec/models/form/sales/pages/previous_bedrooms_spec.rb +++ b/spec/models/form/sales/pages/previous_bedrooms_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousBedrooms, type: :model do expect(page.id).to eq("previous_bedrooms") end - it "has the correct header" do - expect(page.header).to eq("About the buyers’ previous property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_ownership_spec.rb b/spec/models/form/sales/pages/previous_ownership_spec.rb index 20433601e..50279956d 100644 --- a/spec/models/form/sales/pages/previous_ownership_spec.rb +++ b/spec/models/form/sales/pages/previous_ownership_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::PreviousOwnership, type: :model do expect(page.id).to eq("example_id") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_property_type_spec.rb b/spec/models/form/sales/pages/previous_property_type_spec.rb index 317421255..357e7dc2e 100644 --- a/spec/models/form/sales/pages/previous_property_type_spec.rb +++ b/spec/models/form/sales/pages/previous_property_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousPropertyType, type: :model do expect(page.id).to eq("previous_property_type") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/previous_shared_spec.rb b/spec/models/form/sales/pages/previous_shared_spec.rb index de7ef9948..e8da9bcd2 100644 --- a/spec/models/form/sales/pages/previous_shared_spec.rb +++ b/spec/models/form/sales/pages/previous_shared_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousShared, type: :model do expect(page.id).to eq("previous_shared") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/previous_tenure_spec.rb b/spec/models/form/sales/pages/previous_tenure_spec.rb index cd5b0733d..1dc5ec772 100644 --- a/spec/models/form/sales/pages/previous_tenure_spec.rb +++ b/spec/models/form/sales/pages/previous_tenure_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PreviousTenure, type: :model do expect(page.id).to eq("shared_ownership_previous_tenure") end - it "has the correct header" do - expect(page.header).to eq("") - end - it "has the correct description" do expect(page.description).to eq("") end diff --git a/spec/models/form/sales/pages/privacy_notice_spec.rb b/spec/models/form/sales/pages/privacy_notice_spec.rb index fc34d42de..1d146f0af 100644 --- a/spec/models/form/sales/pages/privacy_notice_spec.rb +++ b/spec/models/form/sales/pages/privacy_notice_spec.rb @@ -25,29 +25,31 @@ RSpec.describe Form::Sales::Pages::PrivacyNotice, type: :model do expect(page.id).to eq("privacy_notice") end - it "has the correct header" do - expect(page.header).to eq("Ministry of Housing, Communities and Local Government privacy notice") - end - it "has the correct description" do expect(page.description).to be_nil end - it "has correct depends_on" do - expect(page.depends_on).to eq([{ "not_joint_purchase?" => true }, { "jointpur" => nil }]) - end - - context "with joint purchase" do + context "when there are joint buyers" do subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: true) } - let(:page_id) { "privacy_notice_joint_purchase" } + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.privacynotice.joint_purchase") + end it "has correct depends_on" do expect(page.depends_on).to eq([{ "joint_purchase?" => true }]) end + end + + context "when there is a single buyer" do + subject(:page) { described_class.new(page_id, page_definition, subsection, joint_purchase: false) } - it "has the correct id" do - expect(page.id).to eq("privacy_notice_joint_purchase") + it "has the expected copy_key" do + expect(page.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") + end + + it "has correct depends_on" do + expect(page.depends_on).to eq([{ "not_joint_purchase?" => true }, { "jointpur" => nil }]) end end end diff --git a/spec/models/form/sales/pages/property_building_type_spec.rb b/spec/models/form/sales/pages/property_building_type_spec.rb index 6dc653303..aac8fbf24 100644 --- a/spec/models/form/sales/pages/property_building_type_spec.rb +++ b/spec/models/form/sales/pages/property_building_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PropertyBuildingType, type: :model do expect(page.id).to eq("property_building_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_local_authority_spec.rb b/spec/models/form/sales/pages/property_local_authority_spec.rb index 6d94beed0..016d0534d 100644 --- a/spec/models/form/sales/pages/property_local_authority_spec.rb +++ b/spec/models/form/sales/pages/property_local_authority_spec.rb @@ -48,10 +48,6 @@ RSpec.describe Form::Sales::Pages::PropertyLocalAuthority, type: :model do expect(page.id).to eq("property_local_authority") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb b/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb index 6ab6719d7..5fdb6d0d6 100644 --- a/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb +++ b/spec/models/form/sales/pages/property_number_of_bedrooms_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PropertyNumberOfBedrooms, type: :model do expect(page.id).to eq("property_number_of_bedrooms") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_unit_type_spec.rb b/spec/models/form/sales/pages/property_unit_type_spec.rb index 280c27cb5..24bb3ce54 100644 --- a/spec/models/form/sales/pages/property_unit_type_spec.rb +++ b/spec/models/form/sales/pages/property_unit_type_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PropertyUnitType, type: :model do expect(page.id).to eq("property_unit_type") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb index a77c26af2..9d60c5f3c 100644 --- a/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/pages/property_wheelchair_accessible_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::PropertyWheelchairAccessible, type: :model do expect(page.id).to eq("property_wheelchair_accessible") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb b/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb index 1aefb1e43..27ab0b422 100644 --- a/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb +++ b/spec/models/form/sales/pages/purchase_price_outright_ownership_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PurchasePriceOutrightOwnership, type: :model expect(page.id).to eq("purchase_price") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/purchase_price_spec.rb b/spec/models/form/sales/pages/purchase_price_spec.rb index 57cf526ad..e5bfb176a 100644 --- a/spec/models/form/sales/pages/purchase_price_spec.rb +++ b/spec/models/form/sales/pages/purchase_price_spec.rb @@ -23,10 +23,6 @@ RSpec.describe Form::Sales::Pages::PurchasePrice, type: :model do expect(page.id).to eq("purchase_price") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/purchaser_code_spec.rb b/spec/models/form/sales/pages/purchaser_code_spec.rb index d342b1683..68a853826 100644 --- a/spec/models/form/sales/pages/purchaser_code_spec.rb +++ b/spec/models/form/sales/pages/purchaser_code_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::PurchaserCode, type: :model do expect(page.id).to eq("purchaser_code") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/resale_spec.rb b/spec/models/form/sales/pages/resale_spec.rb index ec4fcd218..3916a26e5 100644 --- a/spec/models/form/sales/pages/resale_spec.rb +++ b/spec/models/form/sales/pages/resale_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Resale, type: :model do expect(page.id).to eq("resale") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/retirement_value_check_spec.rb b/spec/models/form/sales/pages/retirement_value_check_spec.rb index b09760ff5..6df7a379b 100644 --- a/spec/models/form/sales/pages/retirement_value_check_spec.rb +++ b/spec/models/form/sales/pages/retirement_value_check_spec.rb @@ -13,10 +13,6 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do expect(page.subsection).to eq(subsection) end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/sale_date_check_spec.rb b/spec/models/form/sales/pages/sale_date_check_spec.rb index d87a4be45..c8d9d4c5f 100644 --- a/spec/models/form/sales/pages/sale_date_check_spec.rb +++ b/spec/models/form/sales/pages/sale_date_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SaleDateCheck, type: :model do expect(page.id).to eq("completion_date_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct title_text" do expect(page.title_text).to eq({ "translation" => "soft_validations.saledate.must_be_less_than_3_years_from_hodate", diff --git a/spec/models/form/sales/pages/sale_date_spec.rb b/spec/models/form/sales/pages/sale_date_spec.rb index 63be88b02..c606d332a 100644 --- a/spec/models/form/sales/pages/sale_date_spec.rb +++ b/spec/models/form/sales/pages/sale_date_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SaleDate, type: :model do expect(page.id).to eq("completion_date") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/savings_spec.rb b/spec/models/form/sales/pages/savings_spec.rb index 93032ef31..3dca07e8d 100644 --- a/spec/models/form/sales/pages/savings_spec.rb +++ b/spec/models/form/sales/pages/savings_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Savings, type: :model do expect(page.id).to eq("savings") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/savings_value_check_spec.rb b/spec/models/form/sales/pages/savings_value_check_spec.rb index 7f530e3c6..81672977d 100644 --- a/spec/models/form/sales/pages/savings_value_check_spec.rb +++ b/spec/models/form/sales/pages/savings_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SavingsValueCheck, type: :model do expect(page.id).to eq("savings_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { "not_joint_purchase?" => true, diff --git a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb index 0b671fe9c..3a1c22f24 100644 --- a/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode expect(page.id).to eq("shared_ownership_deposit_value_check") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([ { diff --git a/spec/models/form/sales/pages/shared_ownership_type_spec.rb b/spec/models/form/sales/pages/shared_ownership_type_spec.rb index 33d996a2b..d12c49b57 100644 --- a/spec/models/form/sales/pages/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/pages/shared_ownership_type_spec.rb @@ -1,30 +1,13 @@ require "rails_helper" RSpec.describe Form::Sales::Pages::SharedOwnershipType, type: :model do + include CollectionTimeHelper + subject(:page) { described_class.new(page_id, page_definition, subsection) } let(:page_id) { nil } let(:page_definition) { nil } - let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date:, start_year_after_2024?: false)) } - let(:start_date) { Time.utc(2022, 4, 1) } - - describe "headers" do - context "when form is after the year 2023/24" do - let(:start_date) { Time.zone.local(2023, 4, 8) } - - it "has the correct header" do - expect(page.header).to eq("Type of shared ownership sale") - end - end - - context "when form is before the year 2023/24" do - let(:start_date) { Time.zone.local(2022, 2, 8) } - - it "has the correct header" do - expect(page.header).to eq(nil) - end - end - end + let(:subsection) { instance_double(Form::Subsection, form: instance_double(Form, start_date: current_collection_start_date, start_year_after_2024?: true)) } it "has correct subsection" do expect(page.subsection).to eq(subsection) diff --git a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb b/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb index 74ad00e7e..95e59ea4e 100644 --- a/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb +++ b/spec/models/form/sales/pages/staircase_owned_value_check_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::StaircaseOwnedValueCheck, type: :model do expect(page.id).to eq("an_id") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has correct depends_on" do expect(page.depends_on).to eq([{ "staircase_owned_out_of_soft_range?" => true, diff --git a/spec/models/form/sales/pages/staircase_spec.rb b/spec/models/form/sales/pages/staircase_spec.rb index fa17aeede..6f17e7e89 100644 --- a/spec/models/form/sales/pages/staircase_spec.rb +++ b/spec/models/form/sales/pages/staircase_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::Staircase, type: :model do expect(page.id).to eq("staircasing") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/uprn_confirmation_spec.rb b/spec/models/form/sales/pages/uprn_confirmation_spec.rb index bd52233b6..9550b9f49 100644 --- a/spec/models/form/sales/pages/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/pages/uprn_confirmation_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::UprnConfirmation, type: :model do expect(page.id).to eq("uprn_confirmation") end - it "has the correct header" do - expect(page.header).to eq("We found an address that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/uprn_selection_spec.rb b/spec/models/form/sales/pages/uprn_selection_spec.rb index 2e3f3e8f6..22e95bdf4 100644 --- a/spec/models/form/sales/pages/uprn_selection_spec.rb +++ b/spec/models/form/sales/pages/uprn_selection_spec.rb @@ -20,10 +20,6 @@ RSpec.describe Form::Sales::Pages::UprnSelection, type: :model do expect(page.id).to eq("uprn_selection") end - it "has the correct header" do - expect(page.header).to eq("We found some addresses that might be this property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/uprn_spec.rb b/spec/models/form/sales/pages/uprn_spec.rb index 8511af372..17ef3179b 100644 --- a/spec/models/form/sales/pages/uprn_spec.rb +++ b/spec/models/form/sales/pages/uprn_spec.rb @@ -25,10 +25,6 @@ RSpec.describe Form::Sales::Pages::Uprn, type: :model do expect(page.id).to eq("uprn") end - it "has the correct header" do - expect(page.header).to be_nil - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/pages/value_shared_ownership_spec.rb b/spec/models/form/sales/pages/value_shared_ownership_spec.rb index 58a40b2cd..f8232894b 100644 --- a/spec/models/form/sales/pages/value_shared_ownership_spec.rb +++ b/spec/models/form/sales/pages/value_shared_ownership_spec.rb @@ -19,10 +19,6 @@ RSpec.describe Form::Sales::Pages::ValueSharedOwnership, type: :model do expect(page.id).to eq("value_shared_ownership") end - it "has the correct header" do - expect(page.header).to eq("About the price of the property") - end - it "has the correct description" do expect(page.description).to be_nil end diff --git a/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb b/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb index 0272d1329..067b78717 100644 --- a/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb +++ b/spec/models/form/sales/questions/address_line1_for_address_matcher_spec.rb @@ -16,18 +16,10 @@ RSpec.describe Form::Sales::Questions::AddressLine1ForAddressMatcher, type: :mod expect(question.id).to eq("address_line1_input") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Find address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -40,10 +32,6 @@ RSpec.describe Form::Sales::Questions::AddressLine1ForAddressMatcher, type: :mod expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("Address line 1\nAA1 1AA") end diff --git a/spec/models/form/sales/questions/address_line1_spec.rb b/spec/models/form/sales/questions/address_line1_spec.rb index 520587cb3..c64297f48 100644 --- a/spec/models/form/sales/questions/address_line1_spec.rb +++ b/spec/models/form/sales/questions/address_line1_spec.rb @@ -15,18 +15,10 @@ RSpec.describe Form::Sales::Questions::AddressLine1, type: :model do expect(question.id).to eq("address_line1") end - it "has the correct header" do - expect(question.header).to eq("Address line 1") - end - it "has the correct error label" do expect(question.error_label).to eq("Address line 1") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Address lines 1 and 2") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -39,10 +31,6 @@ RSpec.describe Form::Sales::Questions::AddressLine1, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/address_line2_spec.rb b/spec/models/form/sales/questions/address_line2_spec.rb index 52f7cc0fd..153582204 100644 --- a/spec/models/form/sales/questions/address_line2_spec.rb +++ b/spec/models/form/sales/questions/address_line2_spec.rb @@ -1,6 +1,8 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::AddressLine2, type: :model do + include CollectionTimeHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } @@ -15,14 +17,6 @@ RSpec.describe Form::Sales::Questions::AddressLine2, type: :model do expect(question.id).to eq("address_line2") end - it "has the correct header" do - expect(question.header).to eq("Address line 2 (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +25,6 @@ RSpec.describe Form::Sales::Questions::AddressLine2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/age1_spec.rb b/spec/models/form/sales/questions/age1_spec.rb index d7529ef27..5c5486717 100644 --- a/spec/models/form/sales/questions/age1_spec.rb +++ b/spec/models/form/sales/questions/age1_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Age1, type: :model do expect(question.id).to eq("age1") end - it "has the correct header" do - expect(question.header).to eq("Age") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Age1, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(2) end diff --git a/spec/models/form/sales/questions/age2_spec.rb b/spec/models/form/sales/questions/age2_spec.rb index e1cd82297..8578b51d5 100644 --- a/spec/models/form/sales/questions/age2_spec.rb +++ b/spec/models/form/sales/questions/age2_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Age2, type: :model do expect(question.id).to eq("age2") end - it "has the correct header" do - expect(question.header).to eq("Age") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Age2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(2) end diff --git a/spec/models/form/sales/questions/armed_forces_spec.rb b/spec/models/form/sales/questions/armed_forces_spec.rb index f775c800c..234a25e71 100644 --- a/spec/models/form/sales/questions/armed_forces_spec.rb +++ b/spec/models/form/sales/questions/armed_forces_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ArmedForces, type: :model do expect(question.id).to eq("hhregres") end - it "has the correct header" do - expect(question.header).to eq("Have any of the buyers ever served as a regular in the UK armed forces?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Have any of the buyers ever served as a regular in the UK armed forces?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::ArmedForces, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("A regular is somebody who has served in the Royal Navy, the Royal Marines, the Royal Airforce or Army full time and does not include reserve forces") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/armed_forces_spouse_spec.rb b/spec/models/form/sales/questions/armed_forces_spouse_spec.rb index 92ae3df0c..6808bbb2a 100644 --- a/spec/models/form/sales/questions/armed_forces_spouse_spec.rb +++ b/spec/models/form/sales/questions/armed_forces_spouse_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ArmedForcesSpouse, type: :model do expect(question.id).to eq("armedforcesspouse") end - it "has the correct header" do - expect(question.header).to eq("Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Are any of the buyers a spouse or civil partner of a UK armed forces regular who died in service within the last 2 years?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::ArmedForcesSpouse, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyer1_age_known_spec.rb b/spec/models/form/sales/questions/buyer1_age_known_spec.rb index 5c3c0ba56..e79d6b2c2 100644 --- a/spec/models/form/sales/questions/buyer1_age_known_spec.rb +++ b/spec/models/form/sales/questions/buyer1_age_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1AgeKnown, type: :model do expect(question.id).to eq("age1_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 1’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s age") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -45,10 +37,6 @@ RSpec.describe Form::Sales::Questions::Buyer1AgeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has correct hidden_in_check_answers for" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb index 8cf7d0e81..593a525d2 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_arab_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundArab, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Arab background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundArab, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "16" => { "value" => "Other ethnic group" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb index 8603badf7..f49d64437 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_asian_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundAsian, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Asian or Asian British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundAsian, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "10" => { "value" => "Bangladeshi" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb index 403d68b78..6afe4eaf5 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_black_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundBlack, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Black, African, Caribbean or Black British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundBlack, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "12" => { "value" => "Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb index 9a0357d60..d6e51de58 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_mixed_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundMixed, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s Mixed or Multiple ethnic groups background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundMixed, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "White and Black Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb index 0feae47b7..d08ece820 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_background_white_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model expect(question.id).to eq("ethnic") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 1’s White background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -48,10 +40,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end end context "with 2024/25 form" do @@ -68,10 +56,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicBackgroundWhite, type: :model "3" => { "value" => "Any other White background" }, }) end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end end it "has the correct check_answers_card_number" do diff --git a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb index 552f45244..0bdc6d9c0 100644 --- a/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb +++ b/spec/models/form/sales/questions/buyer1_ethnic_group_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicGroup, type: :model do expect(question.id).to eq("ethnic_group") end - it "has the correct header" do - expect(question.header).to eq("What is buyer 1’s ethnic group?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s ethnic group") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1EthnicGroup, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "White" }, diff --git a/spec/models/form/sales/questions/buyer1_income_known_spec.rb b/spec/models/form/sales/questions/buyer1_income_known_spec.rb index 644bb3e55..4f1c8b445 100644 --- a/spec/models/form/sales/questions/buyer1_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeKnown, type: :model do expect(question.id).to eq("income1nk") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 1’s annual income?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s gross annual income known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer1_income_spec.rb b/spec/models/form/sales/questions/buyer1_income_spec.rb index 7bf56762b..4c9a10295 100644 --- a/spec/models/form/sales/questions/buyer1_income_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Income, type: :model do expect(question.id).to eq("income1") end - it "has the correct header" do - expect(question.header).to eq("Buyer 1’s gross annual income") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s gross annual income") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Income, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments.") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb b/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb index 31f249114..e8cc3410a 100644 --- a/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeValueCheck, type: :model do expect(question.id).to eq("income1_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1 income confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb index 151e4c42d..eccb172f7 100644 --- a/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb +++ b/spec/models/form/sales/questions/buyer1_live_in_property_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1LiveInProperty, type: :model do expect(question.id).to eq("buy1livein") end - it "has the correct header" do - expect(question.header).to eq("Will buyer 1 live in the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Will buyer 1 live in the property?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,10 +34,6 @@ RSpec.describe Form::Sales::Questions::Buyer1LiveInProperty, type: :model do expect(question.conditional_for).to be_nil end - it "has the correct hint" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/buyer1_mortgage_spec.rb b/spec/models/form/sales/questions/buyer1_mortgage_spec.rb index a0790c7f8..6bdad4a4f 100644 --- a/spec/models/form/sales/questions/buyer1_mortgage_spec.rb +++ b/spec/models/form/sales/questions/buyer1_mortgage_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Mortgage, type: :model do expect(question.id).to eq("inc1mort") end - it "has the correct header" do - expect(question.header).to eq("Was buyer 1’s income used for a mortgage application?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s income used for mortgage application") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer1_nationality_spec.rb b/spec/models/form/sales/questions/buyer1_nationality_spec.rb index b27124fbc..557b97b2e 100644 --- a/spec/models/form/sales/questions/buyer1_nationality_spec.rb +++ b/spec/models/form/sales/questions/buyer1_nationality_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Nationality, type: :model do expect(question.id).to eq "national" end - it "has the correct header" do - expect(question.header).to eq "What is buyer 1’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 1’s nationality" - end - it "has the correct type" do expect(question.type).to eq "radio" end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::Buyer1Nationality, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq "Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest." - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "18" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb b/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb index 6a8197370..85742b9a6 100644 --- a/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb +++ b/spec/models/form/sales/questions/buyer1_previous_tenure_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Sales::Questions::Buyer1PreviousTenure, type: :model do expect(question.id).to eq("prevten") end - it "has the correct header" do - expect(question.header).to eq("What was buyer 1’s previous tenure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s previous tenure") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb index 908d12a51..c99e64527 100644 --- a/spec/models/form/sales/questions/buyer1_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer1_working_situation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer1WorkingSituation, type: :model do expect(question.id).to eq("ecstat1") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 1's working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1's working situation") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_age_known_spec.rb b/spec/models/form/sales/questions/buyer2_age_known_spec.rb index 68a8d01b4..2f62bce95 100644 --- a/spec/models/form/sales/questions/buyer2_age_known_spec.rb +++ b/spec/models/form/sales/questions/buyer2_age_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2AgeKnown, type: :model do expect(question.id).to eq("age2_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 2’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s age") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb index ea6c3cc64..0ceb9b61a 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_arab_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundArab, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Arab background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundArab, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "16" => { "value" => "Other ethnic group" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb index 32715afdd..9335c6b15 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_asian_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundAsian, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Asian or Asian British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundAsian, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "10" => { "value" => "Bangladeshi" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb index 820e7cb7a..d9675a051 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_black_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundBlack, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Black, African, Caribbean or Black British background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundBlack, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "12" => { "value" => "Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb index 96f621a0c..1c6b4e8f1 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_mixed_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundMixed, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s Mixed or Multiple ethnic groups background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundMixed, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "White and Black Caribbean" }, diff --git a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb index 3ff9c7f3c..8d81e8897 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_background_white_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model expect(question.id).to eq("ethnicbuy2") end - it "has the correct header" do - expect(question.header).to eq("Which of the following best describes buyer 2’s White background?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic background") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -39,10 +31,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicBackgroundWhite, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - context "with 2023/24 form" do it "has the correct answer_options" do expect(question.answer_options).to eq({ diff --git a/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb b/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb index a94cf56e7..c83e30816 100644 --- a/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb +++ b/spec/models/form/sales/questions/buyer2_ethnic_group_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicGroup, type: :model do expect(question.id).to eq("ethnic_group2") end - it "has the correct header" do - expect(question.header).to eq("What is buyer 2’s ethnic group?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s ethnic group") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2EthnicGroup, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "White" }, diff --git a/spec/models/form/sales/questions/buyer2_income_known_spec.rb b/spec/models/form/sales/questions/buyer2_income_known_spec.rb index 9c6a8a51a..82418f796 100644 --- a/spec/models/form/sales/questions/buyer2_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeKnown, type: :model do expect(question.id).to eq("income2nk") end - it "has the correct header" do - expect(question.header).to eq("Do you know buyer 2’s annual income?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s gross annual income known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_income_spec.rb b/spec/models/form/sales/questions/buyer2_income_spec.rb index f13c51a06..ecd8aecf4 100644 --- a/spec/models/form/sales/questions/buyer2_income_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Income, type: :model do expect(question.id).to eq("income2") end - it "has the correct header" do - expect(question.header).to eq("Buyer 2’s gross annual income") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s gross annual income") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Income, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments.") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb b/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb index 8b0fd4328..80f9793b5 100644 --- a/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeValueCheck, type: :model do expect(question.id).to eq("income2_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2 income confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end diff --git a/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb b/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb index fb464e6d2..a201b660c 100644 --- a/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb +++ b/spec/models/form/sales/questions/buyer2_live_in_property_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LiveInProperty, type: :model do expect(question.id).to eq("buy2livein") end - it "has the correct header" do - expect(question.header).to eq("Will buyer 2 live in the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Will buyer 2 live in the property?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LiveInProperty, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyer2_living_in_spec.rb b/spec/models/form/sales/questions/buyer2_living_in_spec.rb index 4de3f0bcf..4e524fc18 100644 --- a/spec/models/form/sales/questions/buyer2_living_in_spec.rb +++ b/spec/models/form/sales/questions/buyer2_living_in_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LivingIn, type: :model do expect(question.id).to eq "buy2living" end - it "has the correct header" do - expect(question.header).to eq "At the time of purchase, was buyer 2 living at the same address as buyer 1?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2 living at the same address" - end - it "has the correct type" do expect(question.type).to eq "radio" end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::Buyer2LivingIn, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq "" - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyer2_mortgage_spec.rb b/spec/models/form/sales/questions/buyer2_mortgage_spec.rb index d96f094e2..761c80a34 100644 --- a/spec/models/form/sales/questions/buyer2_mortgage_spec.rb +++ b/spec/models/form/sales/questions/buyer2_mortgage_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Mortgage, type: :model do expect(question.id).to eq("inc2mort") end - it "has the correct header" do - expect(question.header).to eq("Was buyer 2’s income used for a mortgage application?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s income used for mortgage application") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/buyer2_nationality_spec.rb b/spec/models/form/sales/questions/buyer2_nationality_spec.rb index 66def77bf..d6d7cae38 100644 --- a/spec/models/form/sales/questions/buyer2_nationality_spec.rb +++ b/spec/models/form/sales/questions/buyer2_nationality_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Nationality, type: :model do expect(question.id).to eq "nationalbuy2" end - it "has the correct header" do - expect(question.header).to eq "What is buyer 2’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2’s nationality" - end - it "has the correct type" do expect(question.type).to eq "radio" end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::Buyer2Nationality, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "18" => { "value" => "United Kingdom" }, diff --git a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb index a4f5ad962..1d478faa9 100644 --- a/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/buyer2_relationship_to_buyer1_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model expect(question.id).to eq("relat2") end - it "has the correct header" do - expect(question.header).to eq("What is buyer 2's relationship to buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2's relationship to buyer 1") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2RelationshipToBuyer1, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "P" => { "value" => "Partner" }, diff --git a/spec/models/form/sales/questions/buyer2_working_situation_spec.rb b/spec/models/form/sales/questions/buyer2_working_situation_spec.rb index 5a27e1b5e..81d1e052f 100644 --- a/spec/models/form/sales/questions/buyer2_working_situation_spec.rb +++ b/spec/models/form/sales/questions/buyer2_working_situation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Buyer2WorkingSituation, type: :model do expect(question.id).to eq("ecstat2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 2's working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2's working situation") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Buyer2WorkingSituation, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Full-time - 30 hours or more" }, diff --git a/spec/models/form/sales/questions/buyer_company_spec.rb b/spec/models/form/sales/questions/buyer_company_spec.rb index 76db2952f..c0284c3a2 100644 --- a/spec/models/form/sales/questions/buyer_company_spec.rb +++ b/spec/models/form/sales/questions/buyer_company_spec.rb @@ -15,10 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyerCompany, type: :model do expect(question.id).to eq("companybuy") end - it "has the correct header" do - expect(question.header).to eq("Is the buyer a company?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -27,10 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyerCompany, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyer_interview_spec.rb b/spec/models/form/sales/questions/buyer_interview_spec.rb index 0cd58eae6..3370a84f5 100644 --- a/spec/models/form/sales/questions/buyer_interview_spec.rb +++ b/spec/models/form/sales/questions/buyer_interview_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do expect(question.id).to eq("noint") end - it "has the correct header" do - expect(question.header).to eq("Was the buyer interviewed for any of the answers you will provide on this log?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer interviewed in person?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You should still try to answer all questions even if the buyer wasn’t interviewed in person") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Yes" }, @@ -42,19 +30,19 @@ RSpec.describe Form::Sales::Questions::BuyerInterview, type: :model do }) end - context "with joint purchase" do + context "when there are joint buyers" do subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } - it "has the correct header" do - expect(question.header).to eq("Were the buyers interviewed for any of the answers you will provide on this log?") + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.noint.joint_purchase") end + end - it "has the correct hint_text" do - expect(question.hint_text).to eq("You should still try to answer all questions even if the buyers weren’t interviewed in person") - end + context "when there is a single buyer" do + subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) } - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyers interviewed in person?") + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.noint.not_joint_purchase") end end end diff --git a/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb b/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb index 9a0ba99c8..984735fe6 100644 --- a/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb +++ b/spec/models/form/sales/questions/buyer_live_in_value_check_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::BuyerLiveInValueCheck, type: :model do expect(question.id).to eq("buyer_livein_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer live in confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -32,10 +24,6 @@ RSpec.describe Form::Sales::Questions::BuyerLiveInValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/buyer_live_spec.rb b/spec/models/form/sales/questions/buyer_live_spec.rb index 8b7d9ce1f..12dfc8be6 100644 --- a/spec/models/form/sales/questions/buyer_live_spec.rb +++ b/spec/models/form/sales/questions/buyer_live_spec.rb @@ -1,16 +1,18 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do + include CollectionTimeHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } let(:question_definition) { nil } let(:page) { instance_double(Form::Page) } let(:subsection) { instance_double(Form::Subsection) } - let(:form) { instance_double(Form, start_date: Time.zone.local(2023, 4, 1)) } + let(:form) { instance_double(Form, start_date: current_collection_start_date) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_after_2024?).and_return(true) allow(page).to receive(:subsection).and_return(subsection) allow(subsection).to receive(:form).and_return(form) end @@ -23,10 +25,6 @@ RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do expect(question.id).to eq("buylivein") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyers living in property") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -41,20 +39,4 @@ RSpec.describe Form::Sales::Questions::BuyerLive, type: :model do "2" => { "value" => "No" }, }) end - - context "with 2023/24 form" do - it "has the correct header" do - expect(question.header).to eq("Will the buyers live in the property?") - end - end - - context "with 2024/25 form" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct header" do - expect(question.header).to eq("Will any buyers live in the property?") - end - end end diff --git a/spec/models/form/sales/questions/buyer_previous_spec.rb b/spec/models/form/sales/questions/buyer_previous_spec.rb index ef46d2fd0..8c37c2ff2 100644 --- a/spec/models/form/sales/questions/buyer_previous_spec.rb +++ b/spec/models/form/sales/questions/buyer_previous_spec.rb @@ -23,28 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do expect(question.id).to eq("soctenant") end - context "when a joint purchase" do - it "has the correct header" do - expect(question.header).to eq("Were any of the buyers private registered providers, housing association or local authority tenants immediately before this sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Any buyers were registered providers, housing association or local authority tenants immediately before this sale?") - end - end - - context "when not a joint purchase" do - let(:joint_purchase) { false } - - it "has the correct header" do - expect(question.header).to eq("Was the buyer a private registered provider, housing association or local authority tenant immediately before this sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer was a registered provider, housing association or local authority tenant immediately before this sale?") - end - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -68,10 +46,6 @@ RSpec.describe Form::Sales::Questions::BuyerPrevious, type: :model do expect(question.conditional_for).to eq(nil) end - it "has the correct hint" do - expect(question.hint_text).to eq(nil) - end - context "when form year is before 2024" do before do allow(form).to receive(:start_year_after_2024?).and_return(false) diff --git a/spec/models/form/sales/questions/buyer_still_serving_spec.rb b/spec/models/form/sales/questions/buyer_still_serving_spec.rb index 64b6ad79f..961da2ce9 100644 --- a/spec/models/form/sales/questions/buyer_still_serving_spec.rb +++ b/spec/models/form/sales/questions/buyer_still_serving_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyerStillServing, type: :model do expect(question.id).to eq("hhregresstill") end - it "has the correct header" do - expect(question.header).to eq("Is the buyer still serving in the UK armed forces?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Are they still serving in the UK armed forces?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyerStillServing, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "4" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/buyers_organisations_spec.rb b/spec/models/form/sales/questions/buyers_organisations_spec.rb index c997c5883..03489f59d 100644 --- a/spec/models/form/sales/questions/buyers_organisations_spec.rb +++ b/spec/models/form/sales/questions/buyers_organisations_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::BuyersOrganisations, type: :model do expect(question.id).to eq("buyers_organisations") end - it "has the correct header" do - expect(question.header).to eq("What organisations were the buyers registered with?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Organisations buyers were registered with") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::BuyersOrganisations, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Select all that apply. This question is optional. If no options are applicable, leave the options blank, and select save and continue.") - end - it "has the correct answer_options" do expect(question.answer_options).to eq( { diff --git a/spec/models/form/sales/questions/combined_income_value_check_spec.rb b/spec/models/form/sales/questions/combined_income_value_check_spec.rb index a47b8a4b3..5ddacfff5 100644 --- a/spec/models/form/sales/questions/combined_income_value_check_spec.rb +++ b/spec/models/form/sales/questions/combined_income_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::CombinedIncomeValueCheck, type: :model do expect(question.id).to eq("combined_income_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Combined income confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::CombinedIncomeValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(nil) end diff --git a/spec/models/form/sales/questions/county_spec.rb b/spec/models/form/sales/questions/county_spec.rb index 0961cba38..650e43165 100644 --- a/spec/models/form/sales/questions/county_spec.rb +++ b/spec/models/form/sales/questions/county_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::County, type: :model do expect(question.id).to eq("county") end - it "has the correct header" do - expect(question.header).to eq("County (optional)") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("County") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::County, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/created_by_id_spec.rb b/spec/models/form/sales/questions/created_by_id_spec.rb index b5294df44..0c21a21c8 100644 --- a/spec/models/form/sales/questions/created_by_id_spec.rb +++ b/spec/models/form/sales/questions/created_by_id_spec.rb @@ -17,22 +17,10 @@ RSpec.describe Form::Sales::Questions::CreatedById, type: :model do expect(question.id).to eq("assigned_to_id") end - it "has the correct header" do - expect(question.header).to eq("Which user are you creating this log for?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Log owner") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "is marked as derived" do expect(question.derived?(nil)).to be true end diff --git a/spec/models/form/sales/questions/deposit_amount_spec.rb b/spec/models/form/sales/questions/deposit_amount_spec.rb index acfab8af7..95404971a 100644 --- a/spec/models/form/sales/questions/deposit_amount_spec.rb +++ b/spec/models/form/sales/questions/deposit_amount_spec.rb @@ -51,22 +51,4 @@ RSpec.describe Form::Sales::Questions::DepositAmount, type: :model do end end end - - describe "hint text" do - context "when optional is false" do - let(:optional) { false } - - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan") - end - end - - context "when optional is true" do - let(:optional) { true } - - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the total cash sum paid by the buyer towards the property that was not funded by the mortgage. This excludes any grant or loan. As this is a fully staircased sale this question is optional. If you do not have the information available click save and continue") - end - end - end end diff --git a/spec/models/form/sales/questions/deposit_discount_spec.rb b/spec/models/form/sales/questions/deposit_discount_spec.rb index add79d0ed..8d3ceb45b 100644 --- a/spec/models/form/sales/questions/deposit_discount_spec.rb +++ b/spec/models/form/sales/questions/deposit_discount_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::DepositDiscount, type: :model do expect(question.id).to eq("cashdis") end - it "has the correct header" do - expect(question.header).to eq("How much cash discount was given through Social HomeBuy?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Cash discount through SocialHomeBuy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::DepositDiscount, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the total cash discount given on the property being purchased through the Social HomeBuy scheme") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/deposit_value_check_spec.rb b/spec/models/form/sales/questions/deposit_value_check_spec.rb index 765782f57..2e861110a 100644 --- a/spec/models/form/sales/questions/deposit_value_check_spec.rb +++ b/spec/models/form/sales/questions/deposit_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do expect(question.id).to eq("deposit_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure that the deposit is this much higher than the buyer's savings?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Deposit confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::DepositValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/sales/questions/discount_spec.rb b/spec/models/form/sales/questions/discount_spec.rb index 0df9175ff..5037e2b4e 100644 --- a/spec/models/form/sales/questions/discount_spec.rb +++ b/spec/models/form/sales/questions/discount_spec.rb @@ -21,14 +21,6 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do expect(question.id).to eq("discount") end - it "has the correct header" do - expect(question.header).to eq("What was the percentage discount?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage discount") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -37,12 +29,6 @@ RSpec.describe Form::Sales::Questions::Discount, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("For Right to Buy (RTB), Preserved Right to Buy (PRTB), and Voluntary Right to Buy (VRTB)

- If discount capped, enter capped %

- If the property is being sold to an existing tenant under the RTB, PRTB, or VRTB schemes, enter the % discount from the full market value that is being given.") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/discounted_ownership_type_spec.rb b/spec/models/form/sales/questions/discounted_ownership_type_spec.rb index 442d015a6..43ecb4ac5 100644 --- a/spec/models/form/sales/questions/discounted_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/discounted_ownership_type_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Sales::Questions::DiscountedOwnershipType, type: :model do expect(question.id).to eq("type") end - it "has the correct header" do - expect(question.header).to eq("What is the type of discounted ownership sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of discounted ownership sale") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb b/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb index bb247af4a..09170a225 100644 --- a/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb +++ b/spec/models/form/sales/questions/discounted_sale_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::DiscountedSaleValueCheck, type: :model do expect(question.id).to eq("discounted_sale_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Discounted sale value confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::DiscountedSaleValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/equity_spec.rb b/spec/models/form/sales/questions/equity_spec.rb index ad80eef50..f58c042f5 100644 --- a/spec/models/form/sales/questions/equity_spec.rb +++ b/spec/models/form/sales/questions/equity_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Equity, type: :model do expect(question.id).to eq("equity") end - it "has the correct header" do - expect(question.header).to eq("What was the initial percentage equity stake purchased?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Initial percentage equity stake") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Equity, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/exchange_date_spec.rb b/spec/models/form/sales/questions/exchange_date_spec.rb index 777e5596c..802b9798d 100644 --- a/spec/models/form/sales/questions/exchange_date_spec.rb +++ b/spec/models/form/sales/questions/exchange_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ExchangeDate, type: :model do expect(question.id).to eq("exdate") end - it "has the correct header" do - expect(question.header).to eq("What is the exchange of contracts date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Exchange of contracts date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/sales/questions/extra_borrowing_spec.rb b/spec/models/form/sales/questions/extra_borrowing_spec.rb index 59c962c63..7cea7103b 100644 --- a/spec/models/form/sales/questions/extra_borrowing_spec.rb +++ b/spec/models/form/sales/questions/extra_borrowing_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::ExtraBorrowing, type: :model do expect(question.id).to eq("extrabor") end - it "has the correct header" do - expect(question.header).to eq("Does this include any extra borrowing?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Any other borrowing?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::ExtraBorrowing, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("") - end end diff --git a/spec/models/form/sales/questions/fromprop_spec.rb b/spec/models/form/sales/questions/fromprop_spec.rb index 5660cbd91..b6caeacd0 100644 --- a/spec/models/form/sales/questions/fromprop_spec.rb +++ b/spec/models/form/sales/questions/fromprop_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Fromprop, type: :model do expect(question.id).to eq("fromprop") end - it "has the correct header" do - expect(question.header).to eq("What was the previous property type?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Previous property type") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Fromprop, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has the correct displayed_answer_options" do expect(question.displayed_answer_options(nil)).to eq({ "1" => { "value" => "Flat or maisonette" }, diff --git a/spec/models/form/sales/questions/gender_identity1_spec.rb b/spec/models/form/sales/questions/gender_identity1_spec.rb index 89989a20f..16a7eeca5 100644 --- a/spec/models/form/sales/questions/gender_identity1_spec.rb +++ b/spec/models/form/sales/questions/gender_identity1_spec.rb @@ -22,14 +22,6 @@ RSpec.describe Form::Sales::Questions::GenderIdentity1, type: :model do expect(question.id).to eq("sex1") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 1’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s gender identity") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -50,24 +42,4 @@ RSpec.describe Form::Sales::Questions::GenderIdentity1, type: :model do it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end - - context "with start year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("Buyer 1 is the person in the household who does the most paid work. If it’s a joint purchase and the buyers do the same amount of paid work, buyer 1 is whoever is the oldest.") - end - end - - context "with start year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end end diff --git a/spec/models/form/sales/questions/gender_identity2_spec.rb b/spec/models/form/sales/questions/gender_identity2_spec.rb index 92ebb4758..486f938a9 100644 --- a/spec/models/form/sales/questions/gender_identity2_spec.rb +++ b/spec/models/form/sales/questions/gender_identity2_spec.rb @@ -22,14 +22,6 @@ RSpec.describe Form::Sales::Questions::GenderIdentity2, type: :model do expect(question.id).to eq("sex2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes buyer 2’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s gender identity") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -56,24 +48,4 @@ RSpec.describe Form::Sales::Questions::GenderIdentity2, type: :model do { "condition" => { "sex2" => "R" }, "value" => "Prefers not to say" }, ]) end - - context "with start year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - end - - context "with start year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end end diff --git a/spec/models/form/sales/questions/grant_spec.rb b/spec/models/form/sales/questions/grant_spec.rb index 124ade07e..b7c0381a1 100644 --- a/spec/models/form/sales/questions/grant_spec.rb +++ b/spec/models/form/sales/questions/grant_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Grant, type: :model do expect(question.id).to eq("grant") end - it "has the correct header" do - expect(question.header).to eq("What was the amount of any loan, grant, discount or subsidy given?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Amount of any loan, grant or subsidy") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Grant, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("For all schemes except Right to Buy (RTB), Preserved Right to Buy (PRTB), Voluntary Right to Buy (VRTB) and Rent to Buy") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/handover_date_check_spec.rb b/spec/models/form/sales/questions/handover_date_check_spec.rb index d59764567..87905545a 100644 --- a/spec/models/form/sales/questions/handover_date_check_spec.rb +++ b/spec/models/form/sales/questions/handover_date_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HandoverDateCheck, type: :model do expect(question.id).to eq("hodate_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Practical completion or handover date check") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::HandoverDateCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/handover_date_spec.rb b/spec/models/form/sales/questions/handover_date_spec.rb index 94119ea32..cd76ec1c0 100644 --- a/spec/models/form/sales/questions/handover_date_spec.rb +++ b/spec/models/form/sales/questions/handover_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HandoverDate, type: :model do expect(question.id).to eq("hodate") end - it "has the correct header" do - expect(question.header).to eq("What is the practical completion or handover date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Practical completion or handover date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/sales/questions/has_leasehold_charges_spec.rb b/spec/models/form/sales/questions/has_leasehold_charges_spec.rb index 2d1034d57..ea5c090a0 100644 --- a/spec/models/form/sales/questions/has_leasehold_charges_spec.rb +++ b/spec/models/form/sales/questions/has_leasehold_charges_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HasLeaseholdCharges, type: :model do expect(question.id).to eq("has_mscharge") end - it "has the correct header" do - expect(question.header).to eq("Does the property have any monthly leasehold charges?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Does the property have any monthly leasehold charges?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::HasLeaseholdCharges, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("For example, service and management charges") - end - it "has correct hidden_in_check_answers for" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/household_disability_spec.rb b/spec/models/form/sales/questions/household_disability_spec.rb index 75a100595..ccb4b7017 100644 --- a/spec/models/form/sales/questions/household_disability_spec.rb +++ b/spec/models/form/sales/questions/household_disability_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HouseholdDisability, type: :model do expect(question.id).to eq("disabled") end - it "has the correct header" do - expect(question.header).to eq("Does anyone in the household consider themselves to have a disability?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Does anyone in the household have a disability?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::HouseholdDisability, type: :model do it "has correct conditional for" do expect(question.conditional_for).to be_nil end - - it "has the correct hint" do - expect(question.hint_text).to eq("This includes any long-term health condition that has an impact on the person's day-to-day life") - end end diff --git a/spec/models/form/sales/questions/household_wheelchair_check_spec.rb b/spec/models/form/sales/questions/household_wheelchair_check_spec.rb index a5e01a5f9..d059fc2e8 100644 --- a/spec/models/form/sales/questions/household_wheelchair_check_spec.rb +++ b/spec/models/form/sales/questions/household_wheelchair_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchairCheck, type: :model do expect(question.id).to eq("wheel_value_check") end - it "has the correct header" do - expect(question.header).to eq("You told us that someone in the household uses a wheelchair.") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Does anyone in the household use a wheelchair?") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchairCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/household_wheelchair_spec.rb b/spec/models/form/sales/questions/household_wheelchair_spec.rb index 0e12f37d0..8530d52f5 100644 --- a/spec/models/form/sales/questions/household_wheelchair_spec.rb +++ b/spec/models/form/sales/questions/household_wheelchair_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchair, type: :model do expect(question.id).to eq("wheel") end - it "has the correct header" do - expect(question.header).to eq("Does anyone in the household use a wheelchair?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::HouseholdWheelchair, type: :model do it "has correct conditional for" do expect(question.conditional_for).to be_nil end - - it "has the correct hint" do - expect(question.hint_text).to eq("This can be inside or outside the home") - end end diff --git a/spec/models/form/sales/questions/housing_benefits_spec.rb b/spec/models/form/sales/questions/housing_benefits_spec.rb index 9a50d053d..21a84a6b8 100644 --- a/spec/models/form/sales/questions/housing_benefits_spec.rb +++ b/spec/models/form/sales/questions/housing_benefits_spec.rb @@ -16,24 +16,6 @@ RSpec.describe Form::Sales::Questions::HousingBenefits, type: :model do expect(question.id).to eq("hb") end - context "when joint purchase is false" do - it "has the correct header" do - expect(question.header).to eq("Was the buyer receiving any of these housing-related benefits immediately before buying this property?") - end - end - - context "when joint purchase is true" do - let(:joint_purchase) { true } - - it "has the correct header" do - expect(question.header).to eq("Were the buyers receiving any of these housing-related benefits immediately before buying this property?") - end - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Housing-related benefits buyer received before buying this property") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,10 +24,6 @@ RSpec.describe Form::Sales::Questions::HousingBenefits, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Housing benefit" }, diff --git a/spec/models/form/sales/questions/joint_purchase_spec.rb b/spec/models/form/sales/questions/joint_purchase_spec.rb index 164ad0e9b..082a2d954 100644 --- a/spec/models/form/sales/questions/joint_purchase_spec.rb +++ b/spec/models/form/sales/questions/joint_purchase_spec.rb @@ -22,14 +22,6 @@ RSpec.describe Form::Sales::Questions::JointPurchase, type: :model do expect(question.id).to eq("jointpur") end - it "has the correct header" do - expect(question.header).to eq("Is this a joint purchase?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Joint purchase") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,24 +36,4 @@ RSpec.describe Form::Sales::Questions::JointPurchase, type: :model do "2" => { "value" => "No" }, }) end - - context "with collection year before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the blank hint_text" do - expect(question.hint_text).to be_nil - end - end - - context "with collection year >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is where two or more people are named as legal owners of the property after the purchase") - end - end end diff --git a/spec/models/form/sales/questions/la_nominations_spec.rb b/spec/models/form/sales/questions/la_nominations_spec.rb index 46c2be023..2bbd4e9ee 100644 --- a/spec/models/form/sales/questions/la_nominations_spec.rb +++ b/spec/models/form/sales/questions/la_nominations_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::LaNominations, type: :model do expect(question.id).to eq("lanomagr") end - it "has the correct header" do - expect(question.header).to eq("Was the household rehoused under a 'local authority nominations agreement'?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Household rehoused under a local authority nominations agreement?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::LaNominations, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("A local authority nominations agreement is a written agreement between a local authority and private registered provider (PRP) that some or all of its sales vacancies are offered to local authorities for rehousing") - end end diff --git a/spec/models/form/sales/questions/leasehold_charges_spec.rb b/spec/models/form/sales/questions/leasehold_charges_spec.rb index 59a0a8658..35c2dd589 100644 --- a/spec/models/form/sales/questions/leasehold_charges_spec.rb +++ b/spec/models/form/sales/questions/leasehold_charges_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::LeaseholdCharges, type: :model do expect(question.id).to eq("mscharge") end - it "has the correct header" do - expect(question.header).to eq("Enter the total monthly charge") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Monthly leasehold charges") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::LeaseholdCharges, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to be 5 end diff --git a/spec/models/form/sales/questions/living_before_purchase_spec.rb b/spec/models/form/sales/questions/living_before_purchase_spec.rb index 8c7a8caae..9ac76887a 100644 --- a/spec/models/form/sales/questions/living_before_purchase_spec.rb +++ b/spec/models/form/sales/questions/living_before_purchase_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchase, type: :model do expect(question.id).to eq("proplen_asked") end - it "has the correct header" do - expect(question.header).to eq("Did the buyer live in the property before purchasing it?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer lived in the property before purchasing") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchase, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq("0" => { "value" => "Yes" }, "1" => { "value" => "No" }) diff --git a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb index 455441a5d..c9893dece 100644 --- a/spec/models/form/sales/questions/living_before_purchase_years_spec.rb +++ b/spec/models/form/sales/questions/living_before_purchase_years_spec.rb @@ -20,14 +20,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.id).to eq("proplen") end - it "has the correct header" do - expect(question.header).to eq("How long did the buyer(s) live in the property before purchase?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of years living in the property before purchase") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -36,10 +28,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You should round this up to the nearest year. If the buyers haven't been living in the property, enter '0'") - end - it "has correct width" do expect(question.width).to eq(5) end @@ -68,14 +56,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.id).to eq("proplen") end - it "has the correct header" do - expect(question.header).to eq("How long did they live there?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of years living in the property before purchase") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -84,10 +64,6 @@ RSpec.describe Form::Sales::Questions::LivingBeforePurchaseYears, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You should round up to the nearest year") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/managing_organisation_spec.rb b/spec/models/form/sales/questions/managing_organisation_spec.rb index 2ebbf5e01..e59d5c821 100644 --- a/spec/models/form/sales/questions/managing_organisation_spec.rb +++ b/spec/models/form/sales/questions/managing_organisation_spec.rb @@ -15,22 +15,10 @@ RSpec.describe Form::Sales::Questions::ManagingOrganisation, type: :model do expect(question.id).to eq("managing_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation is reporting this sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Reported by") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "#displayed_answer_options" do let(:options) { { "" => "Select an option" } } diff --git a/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb b/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb index d1c1b6884..c4faaea96 100644 --- a/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb +++ b/spec/models/form/sales/questions/monthly_charges_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MonthlyChargesValueCheck, type: :model do expect(question.id).to eq("monthly_charges_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Monthly charges confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MonthlyChargesValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/monthly_rent_spec.rb b/spec/models/form/sales/questions/monthly_rent_spec.rb index 3c703a7db..c311ca8a4 100644 --- a/spec/models/form/sales/questions/monthly_rent_spec.rb +++ b/spec/models/form/sales/questions/monthly_rent_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MonthlyRent, type: :model do expect(question.id).to eq("mrent") end - it "has the correct header" do - expect(question.header).to eq("What is the basic monthly rent?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Monthly rent") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MonthlyRent, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Amount paid before any charges") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/mortgage_amount_spec.rb b/spec/models/form/sales/questions/mortgage_amount_spec.rb index 148d16506..9d5e68804 100644 --- a/spec/models/form/sales/questions/mortgage_amount_spec.rb +++ b/spec/models/form/sales/questions/mortgage_amount_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageAmount, type: :model do expect(question.id).to eq("mortgage") end - it "has the correct header" do - expect(question.header).to eq("What is the mortgage amount?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Mortgage amount") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageAmount, type: :model do expect(question).not_to be_derived(nil) end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the amount of mortgage agreed with the mortgage lender. Exclude any deposits or cash payments. Numeric in pounds. Rounded to the nearest pound.") - end - it "has correct width" do expect(question.width).to be(5) end diff --git a/spec/models/form/sales/questions/mortgage_lender_other_spec.rb b/spec/models/form/sales/questions/mortgage_lender_other_spec.rb index e103b0ffd..9701cf19c 100644 --- a/spec/models/form/sales/questions/mortgage_lender_other_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_other_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageLenderOther, type: :model do expect(question.id).to eq("mortgagelenderother") end - it "has the correct header" do - expect(question.header).to eq("What is the other mortgage lender?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Other Mortgage Lender") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -30,8 +22,4 @@ RSpec.describe Form::Sales::Questions::MortgageLenderOther, type: :model do it "is not marked as derived" do expect(question.derived?(nil)).to be false end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end end diff --git a/spec/models/form/sales/questions/mortgage_lender_spec.rb b/spec/models/form/sales/questions/mortgage_lender_spec.rb index d5b2225cc..a7abd4c16 100644 --- a/spec/models/form/sales/questions/mortgage_lender_spec.rb +++ b/spec/models/form/sales/questions/mortgage_lender_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageLender, type: :model do expect(question.id).to eq("mortgagelender") end - it "has the correct header" do - expect(question.header).to eq("What is the name of the mortgage lender?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Mortgage Lender") - end - it "has the correct type" do expect(question.type).to eq("select") end diff --git a/spec/models/form/sales/questions/mortgage_length_spec.rb b/spec/models/form/sales/questions/mortgage_length_spec.rb index 3e6e9b6cf..90c0ccab5 100644 --- a/spec/models/form/sales/questions/mortgage_length_spec.rb +++ b/spec/models/form/sales/questions/mortgage_length_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do expect(question.id).to eq("mortlen") end - it "has the correct header" do - expect(question.header).to eq("What is the length of the mortgage?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Length of mortgage") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,12 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageLength, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq( - "You should round up to the nearest year. Value should not exceed 60 years.", - ) - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/mortgage_value_check_spec.rb b/spec/models/form/sales/questions/mortgage_value_check_spec.rb index ec51da724..4ffe96f74 100644 --- a/spec/models/form/sales/questions/mortgage_value_check_spec.rb +++ b/spec/models/form/sales/questions/mortgage_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MortgageValueCheck, type: :model do expect(question.id).to eq("mortgage_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure that the mortgage is more than 5 times the income used for the mortgage application?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Mortgage confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MortgageValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb b/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb index eb89dd910..5f5983831 100644 --- a/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb +++ b/spec/models/form/sales/questions/multiple_partners_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::MultiplePartnersValueCheck, type: :model expect(question.id).to eq("multiple_partners_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Multiple partners confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::MultiplePartnersValueCheck, type: :model expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/nationality_all_group_spec.rb b/spec/models/form/sales/questions/nationality_all_group_spec.rb index 719a5f13e..a88bf1867 100644 --- a/spec/models/form/sales/questions/nationality_all_group_spec.rb +++ b/spec/models/form/sales/questions/nationality_all_group_spec.rb @@ -45,18 +45,6 @@ RSpec.describe Form::Sales::Questions::NationalityAllGroup, type: :model do it "has correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end - - it "has the correct hint" do - expect(question.hint_text).to eq "If buyer 1 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." - end - - it "has the correct header" do - expect(question.header).to eq "What is buyer 1’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 1’s nationality" - end end context "with buyer 2" do @@ -73,17 +61,5 @@ RSpec.describe Form::Sales::Questions::NationalityAllGroup, type: :model do it "has correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end - - it "has the correct hint" do - expect(question.hint_text).to eq "If buyer 2 is a dual national of the United Kingdom and another country, enter United Kingdom. If they are a dual national of two other countries, the buyer should decide which country to enter." - end - - it "has the correct header" do - expect(question.header).to eq "What is buyer 2’s nationality?" - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2’s nationality" - end end end diff --git a/spec/models/form/sales/questions/nationality_all_spec.rb b/spec/models/form/sales/questions/nationality_all_spec.rb index 171e9f96d..a83beb51d 100644 --- a/spec/models/form/sales/questions/nationality_all_spec.rb +++ b/spec/models/form/sales/questions/nationality_all_spec.rb @@ -15,18 +15,10 @@ RSpec.describe Form::Sales::Questions::NationalityAll, type: :model do expect(question.id).to eq "some_id" end - it "has the correct header" do - expect(question.header).to eq "Enter a nationality" - end - it "has the correct type" do expect(question.type).to eq "select" end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options.count).to eq(203) end @@ -46,10 +38,6 @@ RSpec.describe Form::Sales::Questions::NationalityAll, type: :model do expect(question.check_answers_card_number).to be 1 end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 1’s nationality" - end - it "has the correct question_number" do expect(question.question_number).to be 24 end @@ -62,10 +50,6 @@ RSpec.describe Form::Sales::Questions::NationalityAll, type: :model do expect(question.check_answers_card_number).to be 2 end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq "Buyer 2’s nationality" - end - it "has the correct question_number" do expect(question.question_number).to be 32 end diff --git a/spec/models/form/sales/questions/no_address_found_spec.rb b/spec/models/form/sales/questions/no_address_found_spec.rb index 6d6c2cea5..7dd47a1ee 100644 --- a/spec/models/form/sales/questions/no_address_found_spec.rb +++ b/spec/models/form/sales/questions/no_address_found_spec.rb @@ -14,14 +14,6 @@ RSpec.describe Form::Sales::Questions::NoAddressFound, type: :model do expect(question.id).to eq("address_search_value_check") end - it "has the correct header" do - expect(question.header).to eq("No address found") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to be_nil - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -30,10 +22,6 @@ RSpec.describe Form::Sales::Questions::NoAddressFound, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to be_nil end diff --git a/spec/models/form/sales/questions/number_joint_buyers_spec.rb b/spec/models/form/sales/questions/number_joint_buyers_spec.rb index efece2ecc..9529b3aac 100644 --- a/spec/models/form/sales/questions/number_joint_buyers_spec.rb +++ b/spec/models/form/sales/questions/number_joint_buyers_spec.rb @@ -21,14 +21,6 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do expect(question.id).to eq("jointmore") end - it "has the correct header" do - expect(question.header).to eq("Are there more than 2 joint buyers of this property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("More than 2 joint buyers") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -37,10 +29,6 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("You should still try to answer all questions even if the buyers weren’t interviewed in person") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Yes" }, @@ -48,14 +36,4 @@ RSpec.describe Form::Sales::Questions::NumberJointBuyers, type: :model do "3" => { "value" => "Don’t know" }, }) end - - context "with 2024 form" do - before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) - end - - it "has no hint_text" do - expect(question.hint_text).to be_nil - end - end end diff --git a/spec/models/form/sales/questions/number_of_others_in_property_spec.rb b/spec/models/form/sales/questions/number_of_others_in_property_spec.rb index 188ad750a..7bf19dbe3 100644 --- a/spec/models/form/sales/questions/number_of_others_in_property_spec.rb +++ b/spec/models/form/sales/questions/number_of_others_in_property_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::NumberOfOthersInProperty, type: :model do expect(question.id).to eq("hholdcount") end - it "has the correct header" do - expect(question.header).to eq("Besides the buyers, how many other people live or will live in the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of other people living in the property") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -32,10 +24,6 @@ RSpec.describe Form::Sales::Questions::NumberOfOthersInProperty, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("You can provide details for a maximum of 4 other people for a joint purchase.") - end - it "has the correct min" do expect(question.min).to be 0 end @@ -43,16 +31,4 @@ RSpec.describe Form::Sales::Questions::NumberOfOthersInProperty, type: :model do it "has the correct max" do expect(question.max).to be 15 end - - context "with non joint purchase" do - let(:joint_purchase) { false } - - it "has the correct hint" do - expect(question.hint_text).to eq("You can provide details for a maximum of 5 other people if there is only one buyer.") - end - - it "has the correct header" do - expect(question.header).to eq("Besides the buyer, how many other people live or will live in the property?") - end - end end diff --git a/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb b/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb index 794745c77..3d3eab8a0 100644 --- a/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb +++ b/spec/models/form/sales/questions/old_persons_shared_ownership_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck, type expect(question.id).to eq("old_persons_shared_ownership_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Shared ownership confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::OldPersonsSharedOwnershipValueCheck, type expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/other_ownership_type_spec.rb b/spec/models/form/sales/questions/other_ownership_type_spec.rb index 0507bf749..bcd52bc59 100644 --- a/spec/models/form/sales/questions/other_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/other_ownership_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::OtherOwnershipType, type: :model do expect(question.id).to eq("othtype") end - it "has the correct header" do - expect(question.header).to eq("What type of sale is it?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of other sale") - end - it "has the correct type" do expect(question.type).to eq("text") end diff --git a/spec/models/form/sales/questions/outright_ownership_type_spec.rb b/spec/models/form/sales/questions/outright_ownership_type_spec.rb index 11e0b7b10..0ee30556c 100644 --- a/spec/models/form/sales/questions/outright_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/outright_ownership_type_spec.rb @@ -17,10 +17,6 @@ RSpec.describe Form::Sales::Questions::OutrightOwnershipType, type: :model do expect(question.id).to eq("type") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of outright sale") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,10 +38,6 @@ RSpec.describe Form::Sales::Questions::OutrightOwnershipType, type: :model do }) end - it "has the correct header" do - expect(question.header).to eq("What is the type of outright sale?") - end - describe "partial guidance" do context "when the form is for year 2023/24" do let(:start_date) { Time.zone.local(2023, 4, 8) } diff --git a/spec/models/form/sales/questions/ownership_scheme_spec.rb b/spec/models/form/sales/questions/ownership_scheme_spec.rb index 93cc4f0b2..99ec32684 100644 --- a/spec/models/form/sales/questions/ownership_scheme_spec.rb +++ b/spec/models/form/sales/questions/ownership_scheme_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::OwnershipScheme, type: :model do expect(question.id).to eq("ownershipsch") end - it "has the correct header" do - expect(question.header).to eq("Was this purchase made through an ownership scheme?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Purchase made under ownership scheme") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/owning_organisation_id_spec.rb b/spec/models/form/sales/questions/owning_organisation_id_spec.rb index bc6fad6e5..63f3601f2 100644 --- a/spec/models/form/sales/questions/owning_organisation_id_spec.rb +++ b/spec/models/form/sales/questions/owning_organisation_id_spec.rb @@ -26,22 +26,10 @@ RSpec.describe Form::Sales::Questions::OwningOrganisationId, type: :model do expect(question.id).to eq("owning_organisation_id") end - it "has the correct header" do - expect(question.header).to eq("Which organisation owns this log?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Owning organisation") - end - it "has the correct type" do expect(question.type).to eq("select") end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - describe "answer options" do let(:options) { { "" => "Select an option" } } diff --git a/spec/models/form/sales/questions/partner_under16_value_check_spec.rb b/spec/models/form/sales/questions/partner_under16_value_check_spec.rb index 638d49044..0ecd7a2e0 100644 --- a/spec/models/form/sales/questions/partner_under16_value_check_spec.rb +++ b/spec/models/form/sales/questions/partner_under16_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PartnerUnder16ValueCheck, type: :model do expect(question.id).to eq("partner_under_16_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Partner under 16 confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PartnerUnder16ValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb b/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb index 3ec9f96ae..912fd881e 100644 --- a/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb +++ b/spec/models/form/sales/questions/percentage_discount_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PercentageDiscountValueCheck, type: :mode expect(question.id).to eq("percentage_discount_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage discount confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PercentageDiscountValueCheck, type: :mode expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/person_age_known_spec.rb b/spec/models/form/sales/questions/person_age_known_spec.rb index 66247d075..2f2c12c33 100644 --- a/spec/models/form/sales/questions/person_age_known_spec.rb +++ b/spec/models/form/sales/questions/person_age_known_spec.rb @@ -27,10 +27,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - context "with person 2" do let(:question_id) { "age2_known" } let(:person_index) { 2 } @@ -39,14 +35,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age2_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 2’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age2" => [0], @@ -81,14 +69,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age3_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 3’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age3" => [0], @@ -123,14 +103,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age4_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 4’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age4" => [0], @@ -165,14 +137,6 @@ RSpec.describe Form::Sales::Questions::PersonAgeKnown, type: :model do expect(question.id).to eq("age5_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know person 5’s age?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s age known?") - end - it "has correct conditional for" do expect(question.conditional_for).to eq({ "age5" => [0], diff --git a/spec/models/form/sales/questions/person_age_spec.rb b/spec/models/form/sales/questions/person_age_spec.rb index ff1ff0b2b..5faa046bb 100644 --- a/spec/models/form/sales/questions/person_age_spec.rb +++ b/spec/models/form/sales/questions/person_age_spec.rb @@ -12,10 +12,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.page).to eq(page) end - it "has the correct header" do - expect(question.header).to eq("Age") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -24,10 +20,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct min" do expect(question.min).to eq(0) end @@ -52,10 +44,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age2") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age2_known" => 1 }, @@ -76,10 +64,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age3") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age3_known" => 1 }, @@ -100,10 +84,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age4") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age4_known" => 1 }, @@ -124,10 +104,6 @@ RSpec.describe Form::Sales::Questions::PersonAge, type: :model do expect(question.id).to eq("age5") end - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s age") - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to eq([{ "condition" => { "age5_known" => 1 }, diff --git a/spec/models/form/sales/questions/person_gender_identity_spec.rb b/spec/models/form/sales/questions/person_gender_identity_spec.rb index e38c3c456..32c2a30aa 100644 --- a/spec/models/form/sales/questions/person_gender_identity_spec.rb +++ b/spec/models/form/sales/questions/person_gender_identity_spec.rb @@ -36,26 +36,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do }) end - context "when form year is before 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(false) - end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - end - - context "when form year is >= 2024" do - before do - allow(form).to receive(:start_year_after_2024?).and_return(true) - end - - it "has the correct hint" do - expect(question.hint_text).to eq("This should be however they personally choose to identify from the options below. This may or may not be the same as their biological sex or the sex they were assigned at birth.") - end - end - context "when person 2" do let(:question_id) { "sex2" } let(:person_index) { 2 } @@ -64,14 +44,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 2’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end @@ -91,14 +63,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex3") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 3’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end @@ -118,14 +82,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex4") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 4’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end @@ -145,14 +101,6 @@ RSpec.describe Form::Sales::Questions::PersonGenderIdentity, type: :model do expect(question.id).to eq("sex5") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 5’s gender identity?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s gender identity") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/person_known_spec.rb b/spec/models/form/sales/questions/person_known_spec.rb index 7668ca7b7..8ef91700e 100644 --- a/spec/models/form/sales/questions/person_known_spec.rb +++ b/spec/models/form/sales/questions/person_known_spec.rb @@ -31,10 +31,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.conditional_for).to be_nil end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to be_nil end @@ -47,14 +43,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_2") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 2?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 2?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end @@ -68,14 +56,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_3") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 3?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 3?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(3) end @@ -89,14 +69,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_4") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 4?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 4?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(4) end @@ -110,14 +82,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do expect(question.id).to eq("details_known_5") end - it "has the correct header" do - expect(question.header).to eq("Do you know the details for person 5?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Details known for person 5?") - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb index 821eed3f5..32fb055cd 100644 --- a/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb +++ b/spec/models/form/sales/questions/person_relationship_to_buyer1_spec.rb @@ -41,14 +41,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat2") end - it "has the correct header" do - expect(question.header).to eq("What is Person 2’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end @@ -68,14 +60,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat3") end - it "has the correct header" do - expect(question.header).to eq("What is Person 3’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end @@ -95,14 +79,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat4") end - it "has the correct header" do - expect(question.header).to eq("What is Person 4’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end @@ -122,14 +98,6 @@ RSpec.describe Form::Sales::Questions::PersonRelationshipToBuyer1, type: :model expect(question.id).to eq("relat5") end - it "has the correct header" do - expect(question.header).to eq("What is Person 5’s relationship to Buyer 1?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s relationship to Buyer 1") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb b/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb index bc61c464f..007d53d8f 100644 --- a/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb +++ b/spec/models/form/sales/questions/person_student_not_child_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PersonStudentNotChildValueCheck, type: :m expect(question.id).to eq("student_not_child_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this person is not a child?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Student not a child confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PersonStudentNotChildValueCheck, type: :m expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/person_working_situation_spec.rb b/spec/models/form/sales/questions/person_working_situation_spec.rb index 29641dd05..a9f5316cd 100644 --- a/spec/models/form/sales/questions/person_working_situation_spec.rb +++ b/spec/models/form/sales/questions/person_working_situation_spec.rb @@ -49,14 +49,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat2") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 2’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 2’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(2) end @@ -76,14 +68,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat3") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 3’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 3’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(3) end @@ -103,14 +87,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat4") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 4’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 4’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(4) end @@ -130,14 +106,6 @@ RSpec.describe Form::Sales::Questions::PersonWorkingSituation, type: :model do expect(question.id).to eq("ecstat5") end - it "has the correct header" do - expect(question.header).to eq("Which of these best describes Person 5’s working situation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Person 5’s working situation") - end - it "has expected check answers card number" do expect(question.check_answers_card_number).to eq(5) end diff --git a/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb b/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb index 5ba7e8505..dacccefc3 100644 --- a/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb +++ b/spec/models/form/sales/questions/postcode_for_address_matcher_spec.rb @@ -16,14 +16,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForAddressMatcher, type: :model d expect(question.id).to eq("postcode_full_input") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq(nil) - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -36,10 +28,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForAddressMatcher, type: :model d expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer label" do expect(question.answer_label(log)).to eq("AA1 1AA") end diff --git a/spec/models/form/sales/questions/postcode_for_full_address_spec.rb b/spec/models/form/sales/questions/postcode_for_full_address_spec.rb index cf4c6c7e6..224141231 100644 --- a/spec/models/form/sales/questions/postcode_for_full_address_spec.rb +++ b/spec/models/form/sales/questions/postcode_for_full_address_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForFullAddress, type: :model do expect(question.id).to eq("postcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Postcode") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::PostcodeForFullAddress, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/postcode_known_spec.rb b/spec/models/form/sales/questions/postcode_known_spec.rb index 2fdbfc670..794c981d4 100644 --- a/spec/models/form/sales/questions/postcode_known_spec.rb +++ b/spec/models/form/sales/questions/postcode_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PostcodeKnown, type: :model do expect(question.id).to eq("pcodenk") end - it "has the correct header" do - expect(question.header).to eq("Do you know the property’s postcode?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property’s postcode") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::PostcodeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/postcode_spec.rb b/spec/models/form/sales/questions/postcode_spec.rb index b33618d72..480d6af60 100644 --- a/spec/models/form/sales/questions/postcode_spec.rb +++ b/spec/models/form/sales/questions/postcode_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Postcode, type: :model do expect(question.id).to eq("postcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property’s postcode") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Postcode, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/previous_bedrooms_spec.rb b/spec/models/form/sales/questions/previous_bedrooms_spec.rb index 2d1085646..2af0d6f78 100644 --- a/spec/models/form/sales/questions/previous_bedrooms_spec.rb +++ b/spec/models/form/sales/questions/previous_bedrooms_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousBedrooms, type: :model do expect(question.id).to eq("frombeds") end - it "has the correct header" do - expect(question.header).to eq("How many bedrooms did the property have?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of bedrooms in previous property") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PreviousBedrooms, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("For bedsits enter 1") - end - it "has correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/previous_la_known_spec.rb b/spec/models/form/sales/questions/previous_la_known_spec.rb index 1a97040fb..d5e536895 100644 --- a/spec/models/form/sales/questions/previous_la_known_spec.rb +++ b/spec/models/form/sales/questions/previous_la_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousLaKnown, type: :model do expect(question.id).to eq("previous_la_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the local authority of buyer 1’s last settled accommodation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Local authority of buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -58,8 +50,4 @@ RSpec.describe Form::Sales::Questions::PreviousLaKnown, type: :model do "prevloc" => [1], }) end - - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s 'last settled home'") - end end diff --git a/spec/models/form/sales/questions/previous_postcode_known_spec.rb b/spec/models/form/sales/questions/previous_postcode_known_spec.rb index bf837acc2..1075b7cd6 100644 --- a/spec/models/form/sales/questions/previous_postcode_known_spec.rb +++ b/spec/models/form/sales/questions/previous_postcode_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcodeKnown, type: :model do expect(question.id).to eq("ppcodenk") end - it "has the correct header" do - expect(question.header).to eq("Do you know the postcode of buyer 1’s last settled accommodation?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcodeKnown, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to eq("This is also known as the household’s 'last settled home'") - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/previous_postcode_spec.rb b/spec/models/form/sales/questions/previous_postcode_spec.rb index 0ddb50c94..10b4c3288 100644 --- a/spec/models/form/sales/questions/previous_postcode_spec.rb +++ b/spec/models/form/sales/questions/previous_postcode_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcode, type: :model do expect(question.id).to eq("ppostcode_full") end - it "has the correct header" do - expect(question.header).to eq("Postcode") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Postcode of buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PreviousPostcode, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb b/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb index 1779f1ece..08aa51bab 100644 --- a/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb +++ b/spec/models/form/sales/questions/previous_tenure_buyer2_spec.rb @@ -13,14 +13,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenureBuyer2, type: :model do expect(question.id).to eq("prevtenbuy2") end - it "has the correct header" do - expect(question.header).to eq("What was buyer 2’s previous tenure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer 2’s previous tenure") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -29,10 +21,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenureBuyer2, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Local authority tenant" }, diff --git a/spec/models/form/sales/questions/previous_tenure_spec.rb b/spec/models/form/sales/questions/previous_tenure_spec.rb index 78b553e14..bd9a0f9ac 100644 --- a/spec/models/form/sales/questions/previous_tenure_spec.rb +++ b/spec/models/form/sales/questions/previous_tenure_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenure, type: :model do expect(question.id).to eq("socprevten") end - it "has the correct header" do - expect(question.header).to eq("What was the previous tenure of the buyer?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Previous property tenure") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PreviousTenure, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("") - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Social Rent" }, diff --git a/spec/models/form/sales/questions/prevloc_spec.rb b/spec/models/form/sales/questions/prevloc_spec.rb index 4db1e3890..d95924810 100644 --- a/spec/models/form/sales/questions/prevloc_spec.rb +++ b/spec/models/form/sales/questions/prevloc_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Sales::Questions::Prevloc, type: :model do expect(question.id).to eq("prevloc") end - it "has the correct header" do - expect(question.header).to eq("Select a local authority") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Local authority of buyer 1’s last settled accommodation") - end - it "has the correct type" do expect(question.type).to eq("select") end diff --git a/spec/models/form/sales/questions/prevown_spec.rb b/spec/models/form/sales/questions/prevown_spec.rb index 4e5d006d9..0555f32a4 100644 --- a/spec/models/form/sales/questions/prevown_spec.rb +++ b/spec/models/form/sales/questions/prevown_spec.rb @@ -16,28 +16,6 @@ RSpec.describe Form::Sales::Questions::Prevown, type: :model do expect(question.id).to eq("prevown") end - context "when sale is not a joint purchase" do - it "has the correct header" do - expect(question.header).to eq("Has the buyer previously owned a property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer previously owned a property.") - end - end - - context "when sale is a joint purchase" do - let(:joint_purchase) { true } - - it "has the correct header" do - expect(question.header).to eq("Have any of the buyers previously owned a property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyers previously owned a property.") - end - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -57,8 +35,4 @@ RSpec.describe Form::Sales::Questions::Prevown, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end end diff --git a/spec/models/form/sales/questions/prevshared_spec.rb b/spec/models/form/sales/questions/prevshared_spec.rb index 9e6184b02..a668ee1f5 100644 --- a/spec/models/form/sales/questions/prevshared_spec.rb +++ b/spec/models/form/sales/questions/prevshared_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Prevshared, type: :model do expect(question.id).to eq("prevshared") end - it "has the correct header" do - expect(question.header).to eq("Was the previous property under shared ownership?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Previous property shared ownership?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::Prevshared, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("For any buyer") - end end diff --git a/spec/models/form/sales/questions/privacy_notice_spec.rb b/spec/models/form/sales/questions/privacy_notice_spec.rb index 9242804ae..11589049d 100644 --- a/spec/models/form/sales/questions/privacy_notice_spec.rb +++ b/spec/models/form/sales/questions/privacy_notice_spec.rb @@ -23,14 +23,6 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do expect(question.id).to eq("privacynotice") end - it "has the correct header" do - expect(question.header).to eq("Declaration") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer has seen the privacy notice?") - end - it "has the correct type" do expect(question.type).to eq("checkbox") end @@ -39,8 +31,20 @@ RSpec.describe Form::Sales::Questions::PrivacyNotice, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil + context "when there are joint buyers" do + subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: true) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.privacynotice.joint_purchase") + end + end + + context "when there is a single buyer" do + subject(:question) { described_class.new(question_id, question_definition, page, joint_purchase: false) } + + it "has the expected copy_key" do + expect(question.copy_key).to eq("sales.setup.privacynotice.not_joint_purchase") + end end context "when the form year is before 2024" do diff --git a/spec/models/form/sales/questions/property_building_type_spec.rb b/spec/models/form/sales/questions/property_building_type_spec.rb index 39048845c..c8a0aecf0 100644 --- a/spec/models/form/sales/questions/property_building_type_spec.rb +++ b/spec/models/form/sales/questions/property_building_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PropertyBuildingType, type: :model do expect(question.id).to eq("builtype") end - it "has the correct header" do - expect(question.header).to eq("What type of building is the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of building") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PropertyBuildingType, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "1" => { "value" => "Purpose built" }, diff --git a/spec/models/form/sales/questions/property_local_authority_spec.rb b/spec/models/form/sales/questions/property_local_authority_spec.rb index 4c3b24064..fcdd81d29 100644 --- a/spec/models/form/sales/questions/property_local_authority_spec.rb +++ b/spec/models/form/sales/questions/property_local_authority_spec.rb @@ -17,14 +17,6 @@ RSpec.describe Form::Sales::Questions::PropertyLocalAuthority, type: :model do expect(question.id).to eq("la") end - it "has the correct header" do - expect(question.header).to eq("What is the property’s local authority?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Local authority") - end - it "has the correct type" do expect(question.type).to eq("select") end diff --git a/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb b/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb index 5008b8c50..7887a84ae 100644 --- a/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb +++ b/spec/models/form/sales/questions/property_number_of_bedrooms_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do expect(question.id).to eq("beds") end - it "has the correct header" do - expect(question.header).to eq("How many bedrooms does the property have?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Number of bedrooms") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::PropertyNumberOfBedrooms, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("A bedsit has 1 bedroom") - end - it "has the correct min" do expect(question.min).to eq(1) end diff --git a/spec/models/form/sales/questions/property_unit_type_spec.rb b/spec/models/form/sales/questions/property_unit_type_spec.rb index 69cb30ad1..c454c7451 100644 --- a/spec/models/form/sales/questions/property_unit_type_spec.rb +++ b/spec/models/form/sales/questions/property_unit_type_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PropertyUnitType, type: :model do expect(question.id).to eq("proptype") end - it "has the correct header" do - expect(question.header).to eq("What type of unit is the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of unit") - end - it "has the correct type" do expect(question.type).to eq("radio") end diff --git a/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb index 54c27f7bb..6b89deff2 100644 --- a/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb +++ b/spec/models/form/sales/questions/property_wheelchair_accessible_spec.rb @@ -21,14 +21,6 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode expect(question.id).to eq("wchair") end - it "has the correct header" do - expect(question.header).to eq("Is the property built or adapted to wheelchair-user standards?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Property built or adapted to wheelchair-user standards") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,14 +36,4 @@ RSpec.describe Form::Sales::Questions::PropertyWheelchairAccessible, type: :mode "3" => { "value" => "Don't know" }, }) end - - context "with 2024 form" do - before do - allow(subsection).to receive(:form).and_return(instance_double(Form, start_year_after_2024?: true, start_date: Time.zone.local(2024, 4, 1))) - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is whether someone who uses a wheelchair is able to make full use of all of the property’s rooms and facilities, including use of both inside and outside space, and entering and exiting the property.") - end - end end diff --git a/spec/models/form/sales/questions/purchase_price_spec.rb b/spec/models/form/sales/questions/purchase_price_spec.rb index b89bdb284..c3d2999a0 100644 --- a/spec/models/form/sales/questions/purchase_price_spec.rb +++ b/spec/models/form/sales/questions/purchase_price_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do expect(question.id).to eq("value") end - it "has the correct header" do - expect(question.header).to eq("What is the full purchase price?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Purchase price") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,12 +23,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq( - "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount", - ) - end - it "has the correct question_number" do expect(question.question_number).to be_nil end @@ -44,12 +30,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do context "when discounted ownership scheme" do subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 2) } - it "has the correct hint" do - expect(question.hint_text).to eq( - "For all schemes, including Right to Acquire (RTA), Right to Buy (RTB), Voluntary Right to Buy (VRTB) or Preserved Right to Buy (PRTB) sales, enter the full price of the property without any discount", - ) - end - it "has the correct question_number" do expect(question.question_number).to eq(100) end @@ -58,10 +38,6 @@ RSpec.describe Form::Sales::Questions::PurchasePrice, type: :model do context "when outright sale" do subject(:question) { described_class.new(question_id, question_definition, page, ownershipsch: 3) } - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct question_number" do expect(question.question_number).to eq(110) end diff --git a/spec/models/form/sales/questions/purchaser_code_spec.rb b/spec/models/form/sales/questions/purchaser_code_spec.rb index 8c5eeb081..80295afd5 100644 --- a/spec/models/form/sales/questions/purchaser_code_spec.rb +++ b/spec/models/form/sales/questions/purchaser_code_spec.rb @@ -15,18 +15,6 @@ RSpec.describe Form::Sales::Questions::PurchaserCode, type: :model do expect(question.id).to eq("purchid") end - it "has the correct header" do - expect(question.header).to eq("What is the purchaser code?") - end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("This is how you usually refer to the purchaser on your own systems.") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Purchaser code") - end - it "has the correct type" do expect(question.type).to eq("text") end diff --git a/spec/models/form/sales/questions/resale_spec.rb b/spec/models/form/sales/questions/resale_spec.rb index 71e4b82e4..a6583a930 100644 --- a/spec/models/form/sales/questions/resale_spec.rb +++ b/spec/models/form/sales/questions/resale_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Resale, type: :model do expect(question.id).to eq("resale") end - it "has the correct header" do - expect(question.header).to eq("Is this a resale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this a resale?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -41,8 +33,4 @@ RSpec.describe Form::Sales::Questions::Resale, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("If the social landlord has previously sold the property to another buyer and is now reselling the property, select 'yes'. If this is the first time the property has been sold, select 'no'.") - end end diff --git a/spec/models/form/sales/questions/retirement_value_check_spec.rb b/spec/models/form/sales/questions/retirement_value_check_spec.rb index af5239011..6af3ed342 100644 --- a/spec/models/form/sales/questions/retirement_value_check_spec.rb +++ b/spec/models/form/sales/questions/retirement_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::RetirementValueCheck, type: :model do expect(question.id).to eq("retirement_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this person is retired?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Retirement confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::RetirementValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/sale_date_check_spec.rb b/spec/models/form/sales/questions/sale_date_check_spec.rb index c3342f04d..211312ba9 100644 --- a/spec/models/form/sales/questions/sale_date_check_spec.rb +++ b/spec/models/form/sales/questions/sale_date_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SaleDateCheck, type: :model do expect(question.id).to eq("saledate_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Sale completion date check") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::SaleDateCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/sale_date_spec.rb b/spec/models/form/sales/questions/sale_date_spec.rb index bbd602aa7..7363b9ddf 100644 --- a/spec/models/form/sales/questions/sale_date_spec.rb +++ b/spec/models/form/sales/questions/sale_date_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SaleDate, type: :model do expect(question.id).to eq("saledate") end - it "has the correct header" do - expect(question.header).to eq("What is the sale completion date?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Sale completion date") - end - it "has the correct type" do expect(question.type).to eq("date") end diff --git a/spec/models/form/sales/questions/savings_nk_spec.rb b/spec/models/form/sales/questions/savings_nk_spec.rb index 0a8d1a140..597138c2e 100644 --- a/spec/models/form/sales/questions/savings_nk_spec.rb +++ b/spec/models/form/sales/questions/savings_nk_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SavingsNk, type: :model do expect(question.id).to eq("savingsnk") end - it "has the correct header" do - expect(question.header).to eq("Do you know how much the buyer had in savings before they paid any deposit for the property?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer’s total savings known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -44,10 +36,6 @@ RSpec.describe Form::Sales::Questions::SavingsNk, type: :model do }) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq( { diff --git a/spec/models/form/sales/questions/savings_spec.rb b/spec/models/form/sales/questions/savings_spec.rb index 632e5574f..792fd5d29 100644 --- a/spec/models/form/sales/questions/savings_spec.rb +++ b/spec/models/form/sales/questions/savings_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Savings, type: :model do expect(question.id).to eq("savings") end - it "has the correct header" do - expect(question.header).to eq("Enter their total savings to the nearest £10") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer’s total savings before any deposit paid") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Savings, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/savings_value_check_spec.rb b/spec/models/form/sales/questions/savings_value_check_spec.rb index d38d27f03..238df8cef 100644 --- a/spec/models/form/sales/questions/savings_value_check_spec.rb +++ b/spec/models/form/sales/questions/savings_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do expect(question.id).to eq("savings_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure the savings are higher than £100,000?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Savings confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::SavingsValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(0) end diff --git a/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb b/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb index e9e86bd42..0c8a37dad 100644 --- a/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb +++ b/spec/models/form/sales/questions/shared_ownership_deposit_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipDepositValueCheck, type: : expect(question.id).to eq("shared_ownership_deposit_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure this is correct?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Shared ownership deposit confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,14 +23,6 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipDepositValueCheck, type: : expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - - # it "has a correct check_answers_card_number" do - # expect(question.check_answers_card_number).to eq(0) - # end - it "has the correct answer_options" do expect(question.answer_options).to eq({ "0" => { "value" => "Yes" }, diff --git a/spec/models/form/sales/questions/shared_ownership_type_spec.rb b/spec/models/form/sales/questions/shared_ownership_type_spec.rb index 4771241e5..19cae6e89 100644 --- a/spec/models/form/sales/questions/shared_ownership_type_spec.rb +++ b/spec/models/form/sales/questions/shared_ownership_type_spec.rb @@ -1,17 +1,19 @@ require "rails_helper" RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do + include CollectionTimeHelper + subject(:question) { described_class.new(question_id, question_definition, page) } let(:question_id) { nil } let(:question_definition) { nil } - let(:start_date) { Time.zone.local(2022, 4, 1) } + let(:start_date) { current_collection_start_date } let(:form) { instance_double(Form, start_date:) } let(:subsection) { instance_double(Form::Subsection, form:) } let(:page) { instance_double(Form::Page, subsection:) } before do - allow(form).to receive(:start_year_after_2024?).and_return(false) + allow(form).to receive(:start_year_after_2024?).and_return(true) end it "has correct page" do @@ -22,14 +24,6 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do expect(question.id).to eq("type") end - it "has the correct header" do - expect(question.header).to eq("What is the type of shared ownership sale?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Type of shared ownership sale") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -38,33 +32,13 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint_text" do - expect(question.hint_text).to eq("A shared ownership sale is when the purchaser buys up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion") - end - - context "when form start date is 2022/23" do - let(:start_date) { Time.zone.local(2022, 4, 1) } - - it "has the correct answer_options" do - expect(question.answer_options).to eq({ - "2" => { "value" => "Shared Ownership" }, - "24" => { "value" => "Old Persons Shared Ownership" }, - "18" => { "value" => "Social HomeBuy (shared ownership purchase)" }, - "16" => { "value" => "Home Ownership for people with Long-Term Disabilities (HOLD)" }, - "28" => { "value" => "Rent to Buy - Shared Ownership" }, - "31" => { "value" => "Right to Shared Ownership" }, - "30" => { "value" => "Shared Ownership - 2021 model lease" }, - }) - end - - it "does not show a top_guidance_partial" do - expect(question.top_guidance_partial).to eq(nil) - end - end - context "when form start date is 2023/24" do let(:start_date) { Time.zone.local(2023, 4, 2) } + before do + allow(form).to receive(:start_year_after_2024?).and_return(false) + end + it "has the correct answer_options" do expect(question.answer_options).to eq({ "2" => { "value" => "Shared Ownership (old model lease)" }, @@ -91,9 +65,5 @@ RSpec.describe Form::Sales::Questions::SharedOwnershipType, type: :model do it "shows shows correct top_guidance_partial" do expect(question.top_guidance_partial).to eq("shared_ownership_type_definitions_2024") end - - it "has the correct hint_text" do - expect(question.hint_text).to eq("When the purchaser buys an initial share of up to 75% of the property value and pays rent to the Private Registered Provider (PRP) on the remaining portion, or a subsequent staircasing transaction") - end end end diff --git a/spec/models/form/sales/questions/staircase_bought_spec.rb b/spec/models/form/sales/questions/staircase_bought_spec.rb index e5cf16a6c..d448e4456 100644 --- a/spec/models/form/sales/questions/staircase_bought_spec.rb +++ b/spec/models/form/sales/questions/staircase_bought_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::StaircaseBought, type: :model do expect(question.id).to eq("stairbought") end - it "has the correct header" do - expect(question.header).to eq("What percentage of the property has been bought in this staircasing transaction?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage bought in this staircasing transaction") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::StaircaseBought, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/staircase_owned_spec.rb b/spec/models/form/sales/questions/staircase_owned_spec.rb index 80cd30543..94d1eac6f 100644 --- a/spec/models/form/sales/questions/staircase_owned_spec.rb +++ b/spec/models/form/sales/questions/staircase_owned_spec.rb @@ -16,28 +16,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwned, type: :model do expect(question.id).to eq("stairowned") end - context "when a joint purchase" do - let(:joint_purchase) { true } - - it "has the correct header" do - expect(question.header).to eq("What percentage of the property do the buyers now own in total?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage the buyers now own in total.") - end - end - - context "when not a joint purchase" do - it "has the correct header" do - expect(question.header).to eq("What percentage of the property does the buyer now own in total?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage the buyer now owns in total.") - end - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -46,10 +24,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwned, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct width" do expect(question.width).to eq(5) end diff --git a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb b/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb index 0119e725b..4298e40b8 100644 --- a/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb +++ b/spec/models/form/sales/questions/staircase_owned_value_check_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwnedValueCheck, type: :model do expect(question.id).to eq("stairowned_value_check") end - it "has the correct header" do - expect(question.header).to eq("Are you sure?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Percentage owned confirmation") - end - it "has the correct type" do expect(question.type).to eq("interruption_screen") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::StaircaseOwnedValueCheck, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has a correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(nil) end diff --git a/spec/models/form/sales/questions/staircase_sale_spec.rb b/spec/models/form/sales/questions/staircase_sale_spec.rb index f4457811b..d330aecb3 100644 --- a/spec/models/form/sales/questions/staircase_sale_spec.rb +++ b/spec/models/form/sales/questions/staircase_sale_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::StaircaseSale, type: :model do expect(question.id).to eq("staircasesale") end - it "has the correct header" do - expect(question.header).to eq("Is this transaction part of a back-to-back staircasing transaction to facilitate sale of the home on the open market?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Part of a back-to-back staircasing transaction") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::StaircaseSale, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to be_nil - end end diff --git a/spec/models/form/sales/questions/staircase_spec.rb b/spec/models/form/sales/questions/staircase_spec.rb index a4b176d8a..7b45891da 100644 --- a/spec/models/form/sales/questions/staircase_spec.rb +++ b/spec/models/form/sales/questions/staircase_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Staircase, type: :model do expect(question.id).to eq("staircase") end - it "has the correct header" do - expect(question.header).to eq("Is this a staircasing transaction?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Staircasing transaction") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -42,8 +34,4 @@ RSpec.describe Form::Sales::Questions::Staircase, type: :model do it "has correct conditional for" do expect(question.conditional_for).to eq(nil) end - - it "has the correct hint" do - expect(question.hint_text).to eq("A staircasing transaction is when the household purchases more shares in their property, increasing the proportion they own and decreasing the proportion the housing association owns. Once the household purchases 100% of the shares, they own the property") - end end diff --git a/spec/models/form/sales/questions/town_or_city_spec.rb b/spec/models/form/sales/questions/town_or_city_spec.rb index dfa3ddffc..8516992b6 100644 --- a/spec/models/form/sales/questions/town_or_city_spec.rb +++ b/spec/models/form/sales/questions/town_or_city_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::TownOrCity, type: :model do expect(question.id).to eq("town_or_city") end - it "has the correct header" do - expect(question.header).to eq("Town or city") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Town or city") - end - it "has the correct question_number" do expect(question.question_number).to eq(15) end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::TownOrCity, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct inferred check answers value" do expect(question.inferred_check_answers_value).to be_nil end diff --git a/spec/models/form/sales/questions/uprn_confirmation_spec.rb b/spec/models/form/sales/questions/uprn_confirmation_spec.rb index bb5688944..ddb047937 100644 --- a/spec/models/form/sales/questions/uprn_confirmation_spec.rb +++ b/spec/models/form/sales/questions/uprn_confirmation_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do expect(question.id).to eq("uprn_confirmed") end - it "has the correct header" do - expect(question.header).to eq("Is this the property address?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Is this the right address?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::UprnConfirmation, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("You must answer is this the right address?") end diff --git a/spec/models/form/sales/questions/uprn_known_spec.rb b/spec/models/form/sales/questions/uprn_known_spec.rb index 9b25defc8..d3a91a3ef 100644 --- a/spec/models/form/sales/questions/uprn_known_spec.rb +++ b/spec/models/form/sales/questions/uprn_known_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do expect(question.id).to eq("uprn_known") end - it "has the correct header" do - expect(question.header).to eq("Do you know the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN known?") - end - it "has the correct type" do expect(question.type).to eq("radio") end @@ -46,14 +38,6 @@ RSpec.describe Form::Sales::Questions::UprnKnown, type: :model do expect(question.unanswered_error_message).to eq("You must answer UPRN known?") end - it "has the correct hint" do - expect(question.hint_text).to eq( - "The Unique Property Reference Number (UPRN) is a unique number system created by Ordnance Survey and used by housing providers and various industries across the UK. An example UPRN is 10010457355.

- The UPRN may not be the same as the property reference assigned by your organisation.

- If you don’t know the UPRN you can enter the address of the property instead on the next screen.", - ) - end - it "has the correct hidden_in_check_answers" do expect(question.hidden_in_check_answers).to eq({ "depends_on" => [ diff --git a/spec/models/form/sales/questions/uprn_selection_spec.rb b/spec/models/form/sales/questions/uprn_selection_spec.rb index cd23a8e9f..ff1b1a6dd 100644 --- a/spec/models/form/sales/questions/uprn_selection_spec.rb +++ b/spec/models/form/sales/questions/uprn_selection_spec.rb @@ -32,14 +32,6 @@ RSpec.describe Form::Sales::Questions::UprnSelection, type: :model do expect(question.id).to eq("uprn_selection") end - it "has the correct header" do - expect(question.header).to eq("Select the correct address") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Select the correct address") - end - it "has the correct question_number" do expect(question.question_number).to eq(nil) end @@ -52,10 +44,6 @@ RSpec.describe Form::Sales::Questions::UprnSelection, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct answer options" do stub_request(:get, /api\.os\.uk/) .to_return(status: 200, body: "", headers: {}) diff --git a/spec/models/form/sales/questions/uprn_spec.rb b/spec/models/form/sales/questions/uprn_spec.rb index 845358bce..9e601dcb9 100644 --- a/spec/models/form/sales/questions/uprn_spec.rb +++ b/spec/models/form/sales/questions/uprn_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Uprn, type: :model do expect(question.id).to eq("uprn") end - it "has the correct header" do - expect(question.header).to eq("What is the property's UPRN?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("UPRN") - end - it "has the correct type" do expect(question.type).to eq("text") end @@ -35,10 +27,6 @@ RSpec.describe Form::Sales::Questions::Uprn, type: :model do expect(question.question_number).to eq(14) end - it "has the correct hint" do - expect(question.hint_text).to be_nil - end - it "has the correct unanswered_error_message" do expect(question.unanswered_error_message).to eq("UPRN must be 12 digits or less.") end diff --git a/spec/models/form/sales/questions/value_spec.rb b/spec/models/form/sales/questions/value_spec.rb index ad3d2c4c9..771607c16 100644 --- a/spec/models/form/sales/questions/value_spec.rb +++ b/spec/models/form/sales/questions/value_spec.rb @@ -15,14 +15,6 @@ RSpec.describe Form::Sales::Questions::Value, type: :model do expect(question.id).to eq("value") end - it "has the correct header" do - expect(question.header).to eq("What was the full purchase price?") - end - - it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Full purchase price") - end - it "has the correct type" do expect(question.type).to eq("numeric") end @@ -31,10 +23,6 @@ RSpec.describe Form::Sales::Questions::Value, type: :model do expect(question.derived?(nil)).to be false end - it "has the correct hint" do - expect(question.hint_text).to eq("Enter the full purchase price of the property before any discounts are applied. For shared ownership, enter the full purchase price paid for 100% equity (this is equal to the value of the share owned by the PRP plus the value bought by the purchaser)") - end - it "has correct width" do expect(question.width).to eq(5) end