From 53da6aced9e76d1e12084da57bb8c8c974a812b0 Mon Sep 17 00:00:00 2001 From: Arthur Campbell Date: Fri, 10 Feb 2023 17:11:25 +0000 Subject: [PATCH] correct linting errors, minor test failure and typo --- .../validations/sales/financial_validations.rb | 6 +++--- spec/helpers/interruption_screen_helper_spec.rb | 12 ++++++------ spec/models/form_handler_spec.rb | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/models/validations/sales/financial_validations.rb b/app/models/validations/sales/financial_validations.rb index 5d27110ae..21f3743ca 100644 --- a/app/models/validations/sales/financial_validations.rb +++ b/app/models/validations/sales/financial_validations.rb @@ -3,7 +3,7 @@ module Validations::Sales::FinancialValidations # or 'validate_' to run on submit as well def validate_income1(record) - return unless record.income1 && record.la && record.shared_owhership_scheme? + return unless record.income1 && record.la && record.shared_ownership_scheme? relevant_fields = %i[income1 ownershipsch la postcode_full] if record.london_property? && record.income1 > 90_000 @@ -14,7 +14,7 @@ module Validations::Sales::FinancialValidations end def validate_income2(record) - return unless record.income2 && record.la && record.shared_owhership_scheme? + return unless record.income2 && record.la && record.shared_ownership_scheme? relevant_fields = %i[income2 ownershipsch la postcode_full] if record.london_property? && record.income2 > 90_000 @@ -25,7 +25,7 @@ module Validations::Sales::FinancialValidations end def validate_combined_income(record) - return unless record.income1 && record.income2 && record.la && record.shared_owhership_scheme? + return unless record.income1 && record.income2 && record.la && record.shared_ownership_scheme? combined_income = record.income1 + record.income2 relevant_fields = %i[income1 income2 ownershipsch la postcode_full] diff --git a/spec/helpers/interruption_screen_helper_spec.rb b/spec/helpers/interruption_screen_helper_spec.rb index 570cf74fc..f46aca9ae 100644 --- a/spec/helpers/interruption_screen_helper_spec.rb +++ b/spec/helpers/interruption_screen_helper_spec.rb @@ -105,8 +105,8 @@ RSpec.describe InterruptionScreenHelper do { "key" => "earnings", "i18n_template" => "argument", - } - ] + }, + ], } expect(display_informative_text(informative_text_hash, lettings_log)).to eq(I18n.t(translation, argument: lettings_log.earnings)) end @@ -120,8 +120,8 @@ RSpec.describe InterruptionScreenHelper do "key" => "retirement_age_for_person", "arguments_for_key" => 1, "i18n_template" => "argument", - } - ] + }, + ], } allow(lettings_log).to receive(:retirement_age_for_person) display_informative_text(informative_text_hash, lettings_log) @@ -137,8 +137,8 @@ RSpec.describe InterruptionScreenHelper do "key" => "retirement_age_for_person", "arguments_for_key" => 1, "i18n_template" => "argument", - } - ] + }, + ], } expect(display_informative_text(informative_text_hash, lettings_log)).to eq(I18n.t(translation, argument: lettings_log.retirement_age_for_person(1))) end diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index 15ad96ca3..bffb7d7bd 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -52,14 +52,14 @@ RSpec.describe FormHandler do it "is able to load a current sales form" do form = form_handler.get_form("current_sales") expect(form).to be_a(Form) - expect(form.pages.count).to eq(212) + expect(form.pages.count).to eq(181) expect(form.name).to eq("2022_2023_sales") end it "is able to load a previous sales form" do form = form_handler.get_form("previous_sales") expect(form).to be_a(Form) - expect(form.pages.count).to eq(212) + expect(form.pages.count).to eq(181) expect(form.name).to eq("2021_2022_sales") end end