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
Fix unit test
Christophe Bliard8d1dd284a0f6
diff --git a/app/services/work_packages/set_attributes_service.rb b/app/services/work_packages/set_attributes_service.rbindex 6b575eb8c1d..232cbf5065a 100644--- a/app/services/work_packages/set_attributes_service.rb+++ b/app/services/work_packages/set_attributes_service.rb@@ -182,11 +182,7 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributesdef update_durationreturn unless date_changed_but_not_duration?- work_package.duration = if work_package.start_date && work_package.due_date- work_package.due_date - work_package.start_date + 1- else- 1- end+ work_package.duration = WorkPackages::Shared::Days.for(work_package).duration(work_package.start_date, work_package.due_date)enddef set_version_to_nildiff --git a/spec/services/work_packages/update_service_integration_spec.rb b/spec/services/work_packages/update_service_integration_spec.rbindex 6d5ae3abe22..b088161ed13 100644--- a/spec/services/work_packages/update_service_integration_spec.rb+++ b/spec/services/work_packages/update_service_integration_spec.rb@@ -901,7 +901,8 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model, with_ma# rubocop:enable RSpec/ExampleLengthend- describe 'rescheduling work packages with a parent having a follows relation (Regression #43220)' do+ describe 'rescheduling work packages with a parent having a follows relation (Regression #43220)',+ with_flag: { work_packages_duration_field_active: true } dolet(:predecessor_work_package_attributes) dowork_package_attributes.merge(start_date: Time.zone.today + 1.day,