Browse Source

Fix apostrophe type

pull/2136/head
Rachael Booth 2 years ago
parent
commit
1fe71df7fe
  1. 20
      config/locales/en.yml
  2. 4
      spec/features/form/validations_spec.rb
  3. 20
      spec/models/validations/financial_validations_spec.rb

20
config/locales/en.yml

@ -361,8 +361,8 @@ en:
benefits:
part_or_full_time: "Answer cannot be ‘all’ for income from Universal Credit, state pensions or benefits if the tenant or their partner works part-time or full-time"
earnings:
over_hard_max: "The household's income cannot be greater than %{hard_max} per week given the household’s working situation"
under_hard_min: "The household's income cannot be less than %{hard_min} per week given the household’s working situation"
over_hard_max: "The households income cannot be greater than %{hard_max} per week given the household’s working situation"
under_hard_min: "The households income cannot be less than %{hard_min} per week given the household’s working situation"
freq_missing: "Select how often the household receives income"
earnings_missing: "Enter how much income the household has in total"
income:
@ -376,14 +376,14 @@ en:
less_than_shortfall: "Enter an amount that is more than the shortfall in basic rent"
out_of_range: "Enter a value for the %{charge_name} between £0 and %{maximum_per_period} paid %{frequency}. %{maximum_per_period} is the max limit for rent and charges paid %{frequency} for %{letting_type} lettings owned by a %{provider_type}."
ecstat:
over_hard_max: "The household's income of %{earnings} %{frequency} is too high given the household’s working situation"
under_hard_min: "The household's income of %{earnings} %{frequency} is too low given the household’s working situation"
over_hard_max: "The households income of %{earnings} %{frequency} is too high given the household’s working situation"
under_hard_min: "The households income of %{earnings} %{frequency} is too low given the household’s working situation"
age:
earnings_over_hard_max: "The household's income of %{earnings} %{frequency} is too high for the number of adults. Change either the household income or the age of the tenants."
earnings_over_hard_max: "The households income of %{earnings} %{frequency} is too high for the number of adults. Change either the household income or the age of the tenants."
hhmemb:
earnings:
over_hard_max: "The household's income of %{earnings} %{frequency} is too high for this number of tenants. Change either the household income or number of tenants."
under_hard_min: "The household's income of %{earnings} %{frequency} is too low for this number of tenants. Change either the household income or number of tenants."
over_hard_max: "The households income of %{earnings} %{frequency} is too high for this number of tenants. Change either the household income or number of tenants."
under_hard_min: "The households income of %{earnings} %{frequency} is too low for this number of tenants. Change either the household income or number of tenants."
brent:
below_hard_min: "Rent is below the absolute minimum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms"
above_hard_max: "Rent is higher than the absolute maximum expected for a property of this type. Please check the rent, rent period, local authority and (if general needs) number of bedrooms"
@ -617,12 +617,12 @@ en:
soft_validations:
net_income:
title_text: "You told us that the household's income is %{earnings} %{incfreq}."
title_text: "You told us that the households income is %{earnings} %{incfreq}."
hint_text: "This is %{net_income_higher_or_lower_text} than we would expect for their working situation."
in_soft_min_range:
message: "Net income is lower than expected based on the household's working situation. Are you sure this is correct?"
message: "Net income is lower than expected based on the households working situation. Are you sure this is correct?"
in_soft_max_range:
message: "Net income is higher than expected based on the household's working situation. Are you sure this is correct?"
message: "Net income is higher than expected based on the households working situation. Are you sure this is correct?"
income:
under_soft_min_for_economic_status:
title_text: "You told us income was %{income}."

4
spec/features/form/validations_spec.rb

@ -148,7 +148,7 @@ RSpec.describe "validations" do
it "prompts the user to confirm the value is correct with an interruption screen" do
expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-value-check")
expect(page).to have_content("You told us that the household's income is £750.00 weekly.")
expect(page).to have_content("You told us that the households income is £750.00 weekly.")
expect(page).to have_content("This is higher than we would expect for their working situation.")
expect(page).not_to have_button("Save changes")
click_button("Confirm and continue")
@ -166,7 +166,7 @@ RSpec.describe "validations" do
choose("lettings-log-incfreq-1-field", allow_label_click: true)
click_button("Save and continue")
expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-value-check")
expect(page).not_to have_content("You told us that the household's income is £750.00 weekly.")
expect(page).not_to have_content("You told us that the households income is £750.00 weekly.")
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")
end

20
spec/models/validations/financial_validations_spec.rb

@ -204,11 +204,11 @@ RSpec.describe Validations::FinancialValidations do
record.ecstat1 = 1
financial_validator.validate_net_income(record)
expect(record.errors["earnings"])
.to eq(["The household's income cannot be greater than £1,230.00 per week given the household’s working situation"])
.to eq(["The households income cannot be greater than £1,230.00 per week given the household’s working situation"])
expect(record.errors["ecstat1"])
.to eq(["The household's income of £5,000.00 weekly is too high given the household’s working situation"])
.to eq(["The households income of £5,000.00 weekly is too high given the household’s working situation"])
expect(record.errors["hhmemb"])
.to eq(["The household's income of £5,000.00 weekly is too high for this number of tenants. Change either the household income or number of tenants."])
.to eq(["The households income of £5,000.00 weekly is too high for this number of tenants. Change either the household income or number of tenants."])
end
end
@ -220,11 +220,11 @@ RSpec.describe Validations::FinancialValidations do
record.ecstat1 = 1
financial_validator.validate_net_income(record)
expect(record.errors["earnings"])
.to eq(["The household's income cannot be less than £90.00 per week given the household’s working situation"])
.to eq(["The households income cannot be less than £90.00 per week given the household’s working situation"])
expect(record.errors["ecstat1"])
.to eq(["The household's income of £50.00 weekly is too low given the household’s working situation"])
.to eq(["The households income of £50.00 weekly is too low given the household’s working situation"])
expect(record.errors["hhmemb"])
.to eq(["The household's income of £50.00 weekly is too low for this number of tenants. Change either the household income or number of tenants."])
.to eq(["The households income of £50.00 weekly is too low for this number of tenants. Change either the household income or number of tenants."])
end
end
@ -250,7 +250,7 @@ RSpec.describe Validations::FinancialValidations do
record.ecstat3 = 9
financial_validator.validate_net_income(record)
expect(record.errors["earnings"])
.to eq(["The household's income cannot be less than £150.00 per week given the household’s working situation"])
.to eq(["The households income cannot be less than £150.00 per week given the household’s working situation"])
end
it "adds errors to relevant fields for each tenant when income is too high" do
@ -264,12 +264,12 @@ RSpec.describe Validations::FinancialValidations do
financial_validator.validate_net_income(record)
(1..record.hhmemb).each do |n|
expect(record.errors["ecstat#{n}"])
.to eq(["The household's income of £5,000.00 weekly is too high given the household’s working situation"])
.to eq(["The households income of £5,000.00 weekly is too high given the household’s working situation"])
end
expect(record.errors["age1"]).to be_empty
expect(record.errors["age2"]).to be_empty
expect(record.errors["age3"])
.to eq(["The household's income of £5,000.00 weekly is too high for the number of adults. Change either the household income or the age of the tenants."])
.to eq(["The households income of £5,000.00 weekly is too high for the number of adults. Change either the household income or the age of the tenants."])
(record.hhmemb+1..8).each do |n|
expect(record.errors["ecstat#{n}"]).to be_empty
expect(record.errors["age#{n}"]).to be_empty
@ -287,7 +287,7 @@ RSpec.describe Validations::FinancialValidations do
financial_validator.validate_net_income(record)
(1..record.hhmemb).each do |n|
expect(record.errors["ecstat#{n}"])
.to eq(["The household's income of £50.00 weekly is too low given the household’s working situation"])
.to eq(["The households income of £50.00 weekly is too low given the household’s working situation"])
end
((record.hhmemb+1)..8).each do |n|
expect(record.errors["ecstat#{n}"]).to be_empty

Loading…
Cancel
Save