Browse Source

feat: update tests

pull/2197/head
natdeanlewissoftwire 2 years ago
parent
commit
d32e4bccc6
  1. 4
      spec/models/validations/sales/household_validations_spec.rb
  2. 2
      spec/services/merge/merge_organisations_service_spec.rb

4
spec/models/validations/sales/household_validations_spec.rb

@ -40,9 +40,9 @@ RSpec.describe Validations::Sales::HouseholdValidations do
record.relat2 = "P"
household_validator.validate_household_number_of_other_members(record)
expect(record.errors["relat2"])
.to include(match I18n.t("validations.household.relat.child_under_16_sales"))
.to include(match I18n.t("validations.household.relat.child_under_16_sales", person_num: 2))
expect(record.errors["age2"])
.to include(match I18n.t("validations.household.age.child_under_16_relat_sales"))
.to include(match I18n.t("validations.household.age.child_under_16_relat_sales", person_num: 2))
end
it "validates that person's economic status must be Child" do

2
spec/services/merge/merge_organisations_service_spec.rb

@ -752,7 +752,7 @@ RSpec.describe Merge::MergeOrganisationsService do
expect(absorbing_organisation.owned_schemes.first.locations.map(&:postcode)).to match_array([location, deactivated_location, location_without_startdate, location_with_past_startdate, location_with_future_startdate].map(&:postcode))
expect(absorbing_organisation.owned_schemes.first.locations.find_by(postcode: location_without_startdate.postcode).startdate).to eq(Time.zone.yesterday)
expect(absorbing_organisation.owned_schemes.first.locations.find_by(postcode: location_with_past_startdate.postcode).startdate).to eq(Time.zone.yesterday)
expect(absorbing_organisation.owned_schemes.first.locations.find_by(postcode: location_with_future_startdate.postcode).startdate).to eq(Time.zone.today + 2.months)
expect(absorbing_organisation.owned_schemes.first.locations.find_by(postcode: location_with_future_startdate.postcode).startdate).to eq(Time.zone.local(2024, 4, 1))
absorbed_active_scheme = absorbing_organisation.owned_schemes.find_by(service_name: scheme.service_name)
absorbed_active_location = absorbed_active_scheme.locations.find_by(postcode: location.postcode)
expect(absorbed_active_scheme.service_name).to eq(scheme.service_name)

Loading…
Cancel
Save