@ -21,587 +21,295 @@ RSpec.describe Form::Sales::Pages::RetirementValueCheck, type: :model do
expect ( page . description ) . to be_nil
end
context " with joint purchase " do
context " with person 1 " do
let ( :person_index ) { 1 }
let ( :page_id ) { " person_1_retirement_value_check_joint_purchase " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_1_retirement_value_check_joint_purchase " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_1_retired_under_soft_min_age? " = > true , " jointpur " = > 1 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " is interruption screen page " do
expect ( page . interruption_screen? ) . to eq ( true )
end
context " with person 1 " do
let ( :person_index ) { 1 }
let ( :page_id ) { " person_1_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_1_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_1_retired_under_soft_min_age? " = > true } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
end
context " with person 2 " do
let ( :person_index ) { 2 }
let ( :page_id ) { " person_2_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_2_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_2_retired_under_soft_min_age? " = > true } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
end
context " with person 3 " do
let ( :person_index ) { 3 }
let ( :page_id ) { " person_3_retirement_value_check " }
context " with person 2 " do
let ( :person_index ) { 2 }
let ( :page_id ) { " person_2_retirement_value_check_joint_purchase " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_2_retirement_value_check_joint_purchase " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_2_retired_under_soft_min_age? " = > true , " jointpur " = > 1 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
context " with person 3 " do
let ( :person_index ) { 3 }
let ( :page_id ) { " person_3_retirement_value_check_joint_purchase " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_3_retirement_value_check_joint_purchase " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_3_retired_under_soft_min_age? " = > true , " jointpur " = > 1 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_3_retirement_value_check " )
end
context " with person 4 " do
let ( :person_index ) { 4 }
let ( :page_id ) { " person_4_retirement_value_check_joint_purchase " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_4_retirement_value_check_joint_purchase " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_4_retired_under_soft_min_age? " = > true , " jointpur " = > 1 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_3_retired_under_soft_min_age? " = > true } ] )
end
context " with person 5 " do
let ( :person_index ) { 5 }
let ( :page_id ) { " person_5_retirement_value_check_joint_purchase " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_5_retirement_value_check_joint_purchase " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_5_retired_under_soft_min_age? " = > true , " jointpur " = > 1 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
context " with person 6 " do
let ( :person_index ) { 6 }
let ( :page_id ) { " person_6_retirement_value_check_joint_purchase " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_6_retirement_value_check_joint_purchase " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_6_retired_under_soft_min_age? " = > true , " jointpur " = > 1 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_6 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_6 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_6 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
end
context " without joint purchase " do
context " with person 1 " do
let ( :person_index ) { 1 }
let ( :page_id ) { " person_1_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_1_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_1_retired_under_soft_min_age? " = > true , " jointpur " = > 2 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_1 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
context " with person 4 " do
let ( :person_index ) { 4 }
let ( :page_id ) { " person_4_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_4_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_4_retired_under_soft_min_age? " = > true } ] )
end
context " with person 2 " do
let ( :person_index ) { 2 }
let ( :page_id ) { " person_2_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_2_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_2_retired_under_soft_min_age? " = > true , " jointpur " = > 2 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
end
context " with person 5 " do
let ( :person_index ) { 5 }
let ( :page_id ) { " person_5_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
context " with person 3 " do
let ( :person_index ) { 2 }
let ( :page_id ) { " person_3_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_3_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_2_retired_under_soft_min_age? " = > true , " jointpur " = > 2 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_2 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_5_retirement_value_check " )
end
context " with person 4 " do
let ( :person_index ) { 3 }
let ( :page_id ) { " person_4_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_4_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_3_retired_under_soft_min_age? " = > true , " jointpur " = > 2 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_3 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_5_retired_under_soft_min_age? " = > true } ] )
end
context " with person 5 " do
let ( :person_index ) { 4 }
let ( :page_id ) { " person_5_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_5_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_4_retired_under_soft_min_age? " = > true , " jointpur " = > 2 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_4 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
context " with person 6 " do
let ( :person_index ) { 5 }
let ( :page_id ) { " person_6_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_6_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_5_retired_under_soft_min_age? " = > true , " jointpur " = > 2 } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_5 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
end
it " is interruption screen page " do
expect ( page . interruption_screen? ) . to eq ( true )
context " with person 6 " do
let ( :person_index ) { 6 }
let ( :page_id ) { " person_6_retirement_value_check " }
it " has correct questions " do
expect ( page . questions . map ( & :id ) ) . to eq ( %w[ retirement_value_check ] )
end
it " has the correct id " do
expect ( page . id ) . to eq ( " person_6_retirement_value_check " )
end
it " has correct depends_on " do
expect ( page . depends_on ) . to eq ( [ { " person_6_retired_under_soft_min_age? " = > true } ] )
end
it " has correct title_text " do
expect ( page . title_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.title " ,
" arguments " = > [
{
" key " = > " retirement_age_for_person_6 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
it " has correct informative_text " do
expect ( page . informative_text ) . to eq ( {
" translation " = > " soft_validations.retirement.min.hint_text " ,
" arguments " = > [
{
" key " = > " plural_gender_for_person_6 " ,
" label " = > false ,
" i18n_template " = > " gender " ,
} ,
{
" key " = > " retirement_age_for_person_6 " ,
" label " = > false ,
" i18n_template " = > " age " ,
} ,
] ,
} )
end
end
end