OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
fixup! Fix failing tests by deriving dates in factory
Christophe Bliard2fd25eb4f609
diff --git a/spec/factories/work_package_factory.rb b/spec/factories/work_package_factory.rbindex e676866952f..e08e32515f4 100644--- a/spec/factories/work_package_factory.rb+++ b/spec/factories/work_package_factory.rb@@ -45,13 +45,13 @@ FactoryBot.define do# derive start date if due date and duration were providednext unless %i[due_date duration].all? { |field| __override_names__.include?(field) }- days.start_date(due_date&.to_date, duration)+ due_date && duration && days.start_date(due_date.to_date, duration)enddue_date do# derive due date if start date and duration were providednext unless %i[start_date duration].all? { |field| __override_names__.include?(field) }- days.due_date(start_date&.to_date, duration)+ start_date && duration && days.due_date(start_date.to_date, duration)endduration { days.duration(start_date&.to_date, due_date&.to_date) }diff --git a/spec/models/queries/work_packages/filter/duration_filter_spec.rb b/spec/models/queries/work_packages/filter/duration_filter_spec.rbindex 575da1b1bb6..fa550023631 100644--- a/spec/models/queries/work_packages/filter/duration_filter_spec.rb+++ b/spec/models/queries/work_packages/filter/duration_filter_spec.rb@@ -48,6 +48,7 @@ describe Queries::WorkPackages::Filter::DurationFilter, type: :model doit_behaves_like 'non ar filter'describe '#where' do+ # TODO: 0 duration should not happen in 12.x. Should we remove it?let!(:work_package_zero_duration) { create(:work_package, duration: 0) }let!(:work_package_no_duration) { create(:work_package, duration: nil) }let!(:work_package_with_duration) { create(:work_package, duration: 1) }