Browse Source

feat: update tests and lint

pull/1546/head
natdeanlewissoftwire 3 years ago
parent
commit
368a246a31
  1. 2
      app/models/validations/financial_validations.rb
  2. 11
      spec/models/form/sales/pages/buyer2_nationality_spec.rb

2
app/models/validations/financial_validations.rb

@ -138,7 +138,7 @@ module Validations::FinancialValidations
message = I18n.t("validations.financial.carehome.out_of_range", period:, min_chcharge:, max_chcharge:) message = I18n.t("validations.financial.carehome.out_of_range", period:, min_chcharge:, max_chcharge:)
record.errors.add :period, message record.errors.add :period, message
record.errors.add :chcharge, :out_of_range, message: message record.errors.add :chcharge, :out_of_range, message:
end end
end end
end end

11
spec/models/form/sales/pages/buyer2_nationality_spec.rb

@ -26,6 +26,15 @@ RSpec.describe Form::Sales::Pages::Buyer2Nationality, type: :model do
end end
it "has correct depends_on" do it "has correct depends_on" do
expect(page.depends_on).to eq [{ "joint_purchase?" => true }] expect(page.depends_on).to eq [
{
"joint_purchase?" => true,
"buyer_has_seen_privacy_notice?" => true,
},
{
"joint_purchase?" => true,
"buyer_not_interviewed?" => true,
},
]
end end
end end

Loading…
Cancel
Save