Browse Source

feat: fix typo

pull/1225/head
natdeanlewissoftwire 3 years ago
parent
commit
fc6689defe
  1. 2
      app/models/form/sales/pages/shared_ownership_deposit_value_check.rb
  2. 2
      app/models/validations/sales/sale_information_validations.rb
  3. 2
      config/locales/en.yml
  4. 19
      db/schema.rb
  5. 2
      spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb
  6. 2
      spec/models/validations/sales/sale_information_validations_spec.rb

2
app/models/form/sales/pages/shared_ownership_deposit_value_check.rb

@ -8,7 +8,7 @@ class Form::Sales::Pages::SharedOwnershipDepositValueCheck < ::Form::Page
]
@informative_text = {}
@title_text = {
"translation" => "soft_validations.shared_owhership_deposit.title_text",
"translation" => "soft_validations.shared_ownership_deposit.title_text",
"arguments" => [
{
"key" => "expected_shared_ownership_deposit_value",

2
app/models/validations/sales/sale_information_validations.rb

@ -67,7 +67,7 @@ module Validations::Sales::SaleInformationValidations
def validate_basic_monthly_rent(record)
return unless record.mrent && record.ownershipsch && record.type
if record.shared_owhership_scheme? && !record.old_persons_shared_ownership? && record.mrent > 9999
if record.shared_ownership_scheme? && !record.old_persons_shared_ownership? && record.mrent > 9999
record.errors.add :mrent, I18n.t("validations.sale_information.monthly_rent.higher_than_expected")
record.errors.add :type, I18n.t("validations.sale_information.monthly_rent.higher_than_expected")
end

2
config/locales/en.yml

@ -467,7 +467,7 @@ en:
title_text: "You told us the time between the start of the tenancy and the major repairs completion date is more than 2 years"
void_date:
title_text: "You told us the time between the start of the tenancy and the void date is more than 2 years"
shared_owhership_deposit:
shared_ownership_deposit:
title_text: "Mortgage, deposit and cash discount total should equal £%{expected_shared_ownership_deposit_value}"
devise:

19
db/schema.rb

@ -70,6 +70,17 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_26_145529) do
t.index ["start_year", "lettype", "beds", "la"], name: "index_la_rent_ranges_on_start_year_and_lettype_and_beds_and_la", unique: true
end
create_table "la_sale_ranges", force: :cascade do |t|
t.string "la"
t.integer "bedrooms"
t.decimal "soft_min", precision: 10, scale: 2
t.decimal "soft_max", precision: 10, scale: 2
t.integer "start_year"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["start_year", "bedrooms", "la"], name: "index_la_sale_ranges_on_start_year_bedrooms_la", unique: true
end
create_table "legacy_users", force: :cascade do |t|
t.string "old_user_id"
t.integer "user_id"
@ -487,9 +498,9 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_26_145529) do
t.integer "hoyear"
t.integer "fromprop"
t.integer "socprevten"
t.integer "mortlen"
t.integer "mortgagelender"
t.string "mortgagelenderother"
t.integer "mortlen"
t.integer "extrabor"
t.integer "hhmemb"
t.integer "totadult"
@ -502,12 +513,12 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_26_145529) do
t.boolean "is_la_inferred"
t.bigint "bulk_upload_id"
t.integer "retirement_value_check"
t.integer "deposit_and_mortgage_value_check"
t.integer "grant_value_check"
t.integer "hodate_check"
t.integer "extrabor_value_check"
t.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id"
t.integer "shared_ownership_deposit_value_check"
t.integer "grant_value_check"
t.integer "value_value_check"
t.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id"
t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id"
t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id"
t.index ["updated_by_id"], name: "index_sales_logs_on_updated_by_id"

2
spec/models/form/sales/pages/shared_ownership_deposit_value_check_spec.rb

@ -33,7 +33,7 @@ RSpec.describe Form::Sales::Pages::SharedOwnershipDepositValueCheck, type: :mode
it "has the correct title_text" do
expect(page.title_text).to eq({
"translation" => "soft_validations.shared_owhership_deposit.title_text",
"translation" => "soft_validations.shared_ownership_deposit.title_text",
"arguments" => [
{
"key" => "expected_shared_ownership_deposit_value",

2
spec/models/validations/sales/sale_information_validations_spec.rb

@ -361,7 +361,7 @@ RSpec.describe Validations::Sales::SaleInformationValidations do
end
end
context "when owhership is not discounted" do
context "when ownership is not discounted" do
let(:record) { FactoryBot.build(:sales_log, mortgage: 10_000, deposit: 5_000, grant: 3_000, value: 20_000, discount: 10, ownershipsch: 1) }
it "does not add an error" do

Loading…
Cancel
Save