diff --git a/modules/resource_management/app/models/resource_allocation.rb b/modules/resource_management/app/models/resource_allocation.rb index e4aa02e8d59..2b27148b4ee 100644 --- a/modules/resource_management/app/models/resource_allocation.rb +++ b/modules/resource_management/app/models/resource_allocation.rb @@ -160,7 +160,7 @@ class ResourceAllocation < ApplicationRecord def end_date_after_start_date return if start_date.blank? || end_date.blank? - return if end_date > start_date + return if end_date >= start_date errors.add :end_date, :greater_than_start_date end diff --git a/modules/resource_management/spec/models/resource_allocation_spec.rb b/modules/resource_management/spec/models/resource_allocation_spec.rb index deebb44b66e..f7b8372dc07 100644 --- a/modules/resource_management/spec/models/resource_allocation_spec.rb +++ b/modules/resource_management/spec/models/resource_allocation_spec.rb @@ -400,9 +400,8 @@ RSpec.describe ResourceAllocation do allocation.end_date = Date.new(2026, 1, 1) end - it "is invalid" do - expect(allocation).not_to be_valid - expect(allocation.errors.symbols_for(:end_date)).to include(:greater_than_start_date) + it "is valid (single-day allocation)" do + expect(allocation).to be_valid end end