Browse Source

minor changes for testing and linting

pull/1448/head
Arthur Campbell 3 years ago
parent
commit
7ee79c517a
  1. 2
      app/models/validations/sales/financial_validations.rb
  2. 2
      spec/fixtures/imports/sales_logs/discounted_ownership_sales_log.xml
  3. 4
      spec/models/form/sales/questions/leasehold_charges_spec.rb

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

@ -41,7 +41,7 @@ module Validations::Sales::FinancialValidations
end end
def validate_monthly_leasehold_charges(record) def validate_monthly_leasehold_charges(record)
record.errors.add :mscharge, I18n.t("validations.financial.monthly_leasehold_charges.not_zero") if record.mscharge == 0 record.errors.add :mscharge, I18n.t("validations.financial.monthly_leasehold_charges.not_zero") if record.mscharge&.zero?
end end
def validate_percentage_bought_not_greater_than_percentage_owned(record) def validate_percentage_bought_not_greater_than_percentage_owned(record)

2
spec/fixtures/imports/sales_logs/discounted_ownership_sales_log.xml vendored

@ -280,7 +280,7 @@
<Q34b>33</Q34b> <Q34b>33</Q34b>
<Q35Borrowing>2 No</Q35Borrowing> <Q35Borrowing>2 No</Q35Borrowing>
<Q36CashDeposit>0</Q36CashDeposit> <Q36CashDeposit>0</Q36CashDeposit>
<Q37MonthlyCharges>0.00</Q37MonthlyCharges> <Q37MonthlyCharges>10.00</Q37MonthlyCharges>
</Group> </Group>
<Group> <Group>
<Q40PurchasePrice override-field=""/> <Q40PurchasePrice override-field=""/>

4
spec/models/form/sales/questions/leasehold_charges_spec.rb

@ -36,11 +36,11 @@ RSpec.describe Form::Sales::Questions::LeaseholdCharges, type: :model do
end end
it "has the correct width" do it "has the correct width" do
expect(question.width).to eq(5) expect(question.width).to be 5
end end
it "has the correct min" do it "has the correct min" do
expect(question.min).to eq(0) expect(question.min).to be 1
end end
it "has the correct prefix" do it "has the correct prefix" do

Loading…
Cancel
Save