@ -916,42 +916,42 @@ RSpec.describe Validations::FinancialValidations do
context " and charges are over the valid limit (£1,000 per week) " do
it " validates charge when period is weekly for 52 weeks " do
record . period = 1
record . chcharge = 1 001
record . chcharge = 5 001
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £10.00 and £1 ,000.00 if paying weekly for 52 weeks " )
. to include ( " Household rent and other charges must be between £10.00 and £5 ,000.00 if paying weekly for 52 weeks " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £10.00 and £1 ,000.00 if paying weekly for 52 weeks " )
. to include ( " Household rent and other charges must be between £10.00 and £5 ,000.00 if paying weekly for 52 weeks " )
end
it " validates charge when period is monthly " do
record . period = 4
record . chcharge = 4334
record . chcharge = 21_667
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £43.00 and £4,333 .00 if paying every calendar month " )
. to include ( " Household rent and other charges must be between £43.00 and £21,666 .00 if paying every calendar month " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £43.00 and £4,333 .00 if paying every calendar month " )
. to include ( " Household rent and other charges must be between £43.00 and £21,666 .00 if paying every calendar month " )
end
it " validates charge when period is every 2 weeks " do
record . period = 2
record . chcharge = 2001
record . chcharge = 1 2_ 001
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £20.00 and £2 ,000.00 if paying every 2 weeks " )
. to include ( " Household rent and other charges must be between £20.00 and £10 ,000.00 if paying every 2 weeks " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £20.00 and £2 ,000.00 if paying every 2 weeks " )
. to include ( " Household rent and other charges must be between £20.00 and £10 ,000.00 if paying every 2 weeks " )
end
it " validates charge when period is every 4 weeks " do
record . period = 3
record . chcharge = 4001
record . chcharge = 2 4_ 001
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £40.00 and £4 ,000.00 if paying every 4 weeks " )
. to include ( " Household rent and other charges must be between £40.00 and £20 ,000.00 if paying every 4 weeks " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £40.00 and £4 ,000.00 if paying every 4 weeks " )
. to include ( " Household rent and other charges must be between £40.00 and £20 ,000.00 if paying every 4 weeks " )
end
end
@ -1007,9 +1007,9 @@ RSpec.describe Validations::FinancialValidations do
record . chcharge = 9
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £10.00 and £1 ,000.00 if paying weekly for 52 weeks " )
. to include ( " Household rent and other charges must be between £10.00 and £5 ,000.00 if paying weekly for 52 weeks " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £10.00 and £1 ,000.00 if paying weekly for 52 weeks " )
. to include ( " Household rent and other charges must be between £10.00 and £5 ,000.00 if paying weekly for 52 weeks " )
end
it " validates charge when period is monthly " do
@ -1017,9 +1017,9 @@ RSpec.describe Validations::FinancialValidations do
record . chcharge = 42
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £43.00 and £4,333 .00 if paying every calendar month " )
. to include ( " Household rent and other charges must be between £43.00 and £21,666 .00 if paying every calendar month " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £43.00 and £4,333 .00 if paying every calendar month " )
. to include ( " Household rent and other charges must be between £43.00 and £21,666 .00 if paying every calendar month " )
end
it " validates charge when period is every 2 weeks " do
@ -1027,9 +1027,9 @@ RSpec.describe Validations::FinancialValidations do
record . chcharge = 19
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £20.00 and £2 ,000.00 if paying every 2 weeks " )
. to include ( " Household rent and other charges must be between £20.00 and £10 ,000.00 if paying every 2 weeks " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £20.00 and £2 ,000.00 if paying every 2 weeks " )
. to include ( " Household rent and other charges must be between £20.00 and £10 ,000.00 if paying every 2 weeks " )
end
it " validates charge when period is every 4 weeks " do
@ -1037,9 +1037,9 @@ RSpec.describe Validations::FinancialValidations do
record . chcharge = 39
financial_validator . validate_care_home_charges ( record )
expect ( record . errors [ " chcharge " ] )
. to include ( " Household rent and other charges must be between £40.00 and £4 ,000.00 if paying every 4 weeks " )
. to include ( " Household rent and other charges must be between £40.00 and £20 ,000.00 if paying every 4 weeks " )
expect ( record . errors [ " period " ] )
. to include ( " Household rent and other charges must be between £40.00 and £4 ,000.00 if paying every 4 weeks " )
. to include ( " Household rent and other charges must be between £40.00 and £20 ,000.00 if paying every 4 weeks " )
end
end
end