diff --git a/app/models/validations/date_validations.rb b/app/models/validations/date_validations.rb index d5b8b50f8..d22946dce 100644 --- a/app/models/validations/date_validations.rb +++ b/app/models/validations/date_validations.rb @@ -35,11 +35,6 @@ module Validations::DateValidations record.errors.add :startdate, I18n.t("validations.date.outside_collection_window") end - if record.startdate < Time.zone.today - 14 - record.errors.add :startdate, I18n.t("validations.setup.startdate.later_than_or_14_days_before") - - end - if record.scheme_id.present? scheme_end_date = Scheme.find(record.scheme_id).end_date if scheme_end_date.present? && (record.startdate > scheme_end_date) diff --git a/spec/models/validations/date_validations_spec.rb b/spec/models/validations/date_validations_spec.rb index 91041e8a8..8d53cdbd4 100644 --- a/spec/models/validations/date_validations_spec.rb +++ b/spec/models/validations/date_validations_spec.rb @@ -33,19 +33,6 @@ RSpec.describe Validations::DateValidations do expect(record.errors["startdate"]).to be_empty end - it "validates that the tenancy start date is later than or 14 days before the current date" do - record.startdate = Time.zone.today - 15.days - setup_validator.validate_startdate(record) - expect(record.errors["startdate"]) - .to include(match I18n.t("validations.setup.startdate.later_than_or_14_days_before")) - end - - it "produces no error when the tenancy start date is later than or 14 days before the current date" do - record.startdate = Time.zone.today - 7.days - setup_validator.validate_startdate(record) - expect(record.errors["startdate"]).to be_empty - end - it "validates that the tenancy start date is before the end date of the chosen scheme if it has an end date" do record.startdate = Time.zone.today - 3.days record.scheme = scheme