|
|
|
@ -46,7 +46,7 @@ RSpec.describe Validations::SetupValidations do |
|
|
|
record.location = location |
|
|
|
record.location = location |
|
|
|
setup_validator.validate_scheme(record) |
|
|
|
setup_validator.validate_scheme(record) |
|
|
|
expect(record.errors["scheme_id"]) |
|
|
|
expect(record.errors["scheme_id"]) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.during_deactivated_location")) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.during_deactivated_location", postcode: location.postcode, date: "4 June 2022")) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
@ -71,7 +71,7 @@ RSpec.describe Validations::SetupValidations do |
|
|
|
record.location = location |
|
|
|
record.location = location |
|
|
|
setup_validator.validate_scheme(record) |
|
|
|
setup_validator.validate_scheme(record) |
|
|
|
expect(record.errors["scheme_id"]) |
|
|
|
expect(record.errors["scheme_id"]) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon")) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon", postcode: location.postcode, date: "4 August 2022")) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
@ -98,7 +98,7 @@ RSpec.describe Validations::SetupValidations do |
|
|
|
record.location = location |
|
|
|
record.location = location |
|
|
|
setup_validator.validate_scheme(record) |
|
|
|
setup_validator.validate_scheme(record) |
|
|
|
expect(record.errors["scheme_id"]) |
|
|
|
expect(record.errors["scheme_id"]) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon")) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon", postcode: location.postcode, date: "15 September 2022")) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
@ -118,7 +118,7 @@ RSpec.describe Validations::SetupValidations do |
|
|
|
record.location = location |
|
|
|
record.location = location |
|
|
|
setup_validator.validate_location(record) |
|
|
|
setup_validator.validate_location(record) |
|
|
|
expect(record.errors["location_id"]) |
|
|
|
expect(record.errors["location_id"]) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.during_deactivated_location")) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.during_deactivated_location", postcode: location.postcode, date: "4 June 2022")) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
@ -143,7 +143,7 @@ RSpec.describe Validations::SetupValidations do |
|
|
|
record.location = location |
|
|
|
record.location = location |
|
|
|
setup_validator.validate_location(record) |
|
|
|
setup_validator.validate_location(record) |
|
|
|
expect(record.errors["location_id"]) |
|
|
|
expect(record.errors["location_id"]) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon")) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon", postcode: location.postcode, date: "4 August 2022")) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
it "produces no error when tenancy start date is during an active location period" do |
|
|
|
@ -170,7 +170,7 @@ RSpec.describe Validations::SetupValidations do |
|
|
|
record.location = location |
|
|
|
record.location = location |
|
|
|
setup_validator.validate_location(record) |
|
|
|
setup_validator.validate_location(record) |
|
|
|
expect(record.errors["location_id"]) |
|
|
|
expect(record.errors["location_id"]) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon")) |
|
|
|
.to include(match I18n.t("validations.setup.startdate.location_reactivating_soon", postcode: location.postcode, date: "15 September 2022")) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|