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
Cleanup code for duration / non working days (#11222)
Oliver Günthera6b7bee82231
diff --git a/app/contracts/work_packages/base_contract.rb b/app/contracts/work_packages/base_contract.rbindex 336add5580f..45d2fa9cefb 100644--- a/app/contracts/work_packages/base_contract.rb+++ b/app/contracts/work_packages/base_contract.rb@@ -80,10 +80,7 @@ module WorkPackagesendattribute :schedule_manually- attribute :ignore_non_working_days,- writable: ->(*) {- OpenProject::FeatureDecisions.work_packages_duration_field_active?- }+ attribute :ignore_non_working_daysattribute :start_date,writable: ->(*) {@@ -99,10 +96,7 @@ module WorkPackagesvalidate_after_soonest_start(:due_date)end- attribute :duration,- writable: ->(*) {- OpenProject::FeatureDecisions.work_packages_duration_field_active?- }+ attribute :durationattribute :budget@@ -337,7 +331,7 @@ module WorkPackagesenddef validate_duration_matches_dates- return unless calculated_duration && model.duration && OpenProject::FeatureDecisions.work_packages_duration_field_active?+ return unless calculated_duration && model.durationif calculated_duration > model.durationerrors.add :duration, :smaller_than_dates@@ -353,8 +347,6 @@ module WorkPackagesenddef validate_duration_and_dates_are_not_derivable- return unless OpenProject::FeatureDecisions.work_packages_duration_field_active?-%i[start_date due_date duration].each do |field|if not_set_but_others_are_present?(field)errors.add field, :cannot_be_nulldiff --git a/app/models/queries/work_packages/columns/property_column.rb b/app/models/queries/work_packages/columns/property_column.rbindex 4adfce1395e..0e7a9743ff2 100644--- a/app/models/queries/work_packages/columns/property_column.rb+++ b/app/models/queries/work_packages/columns/property_column.rb@@ -127,8 +127,7 @@ class Queries::WorkPackages::Columns::PropertyColumn < Queries::WorkPackages::Codefault_order: 'desc'},duration: {- sortable: "#{WorkPackage.table_name}.duration",- if: ->(*) { OpenProject::FeatureDecisions.work_packages_duration_field_active? }+ sortable: "#{WorkPackage.table_name}.duration"}}diff --git a/app/services/work_packages/shared/all_days.rb b/app/services/work_packages/shared/all_days.rbindex eacc001cf7a..732a7a1a168 100644--- a/app/services/work_packages/shared/all_days.rb+++ b/app/services/work_packages/shared/all_days.rb@@ -31,7 +31,7 @@ module WorkPackagesclass AllDays# Returns number of days between two dates, inclusive.def duration(start_date, due_date)- return no_duration if start_date.nil? || due_date.nil?+ return nil unless start_date && due_date(start_date..due_date).countend@@ -65,12 +65,6 @@ module WorkPackagesdef working?(_date)trueend-- private-- def no_duration- OpenProject::FeatureDecisions.work_packages_duration_field_active? ? nil : 1- endendendenddiff --git a/app/services/work_packages/shared/days.rb b/app/services/work_packages/shared/days.rbindex eb25cb41805..b74c722aa43 100644--- a/app/services/work_packages/shared/days.rb+++ b/app/services/work_packages/shared/days.rb@@ -31,8 +31,6 @@ module WorkPackagesclass Days# Returns the right day computation instance for the given instance.def self.for(work_package)- return AllDays.new unless OpenProject::FeatureDecisions.work_packages_duration_field_active?-work_package.ignore_non_working_days ? AllDays.new : WorkingDays.newendenddiff --git a/app/services/work_packages/shared/working_days.rb b/app/services/work_packages/shared/working_days.rbindex c15815236b0..2d66b90d520 100644--- a/app/services/work_packages/shared/working_days.rb+++ b/app/services/work_packages/shared/working_days.rb@@ -32,7 +32,7 @@ module WorkPackages# Returns number of working days between two dates, excluding weekend days# and non working days.def duration(start_date, due_date)- return no_duration unless start_date && due_date+ return nil unless start_date && due_date(start_date..due_date).count { working?(_1) }end@@ -106,10 +106,6 @@ module WorkPackagesprivate- def no_duration- OpenProject::FeatureDecisions.work_packages_duration_field_active? ? nil : 1- end-def assert_strictly_positive_duration(duration)raise ArgumentError, 'duration must be strictly positive' if duration.is_a?(Integer) && duration <= 0enddiff --git a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb b/lib/api/v3/work_packages/schema/work_package_schema_representer.rbindex 07d6881f2cd..060c4351a8e 100644--- a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb+++ b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb@@ -120,7 +120,7 @@ module APIschema :duration,type: 'Duration',required: false,- show_if: ->(*) { !represented.milestone? && OpenProject::FeatureDecisions.work_packages_duration_field_active? }+ show_if: ->(*) { !represented.milestone? }schema :schedule_manually,type: 'Boolean',@@ -129,8 +129,7 @@ module APIschema :ignore_non_working_days,type: 'Boolean',- required: false,- show_if: ->(*) { OpenProject::FeatureDecisions.work_packages_duration_field_active? }+ required: falseschema :start_date,type: 'Date',diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rbindex 474886cb285..e324df7ccf3 100644--- a/lib/api/v3/work_packages/work_package_representer.rb+++ b/lib/api/v3/work_packages/work_package_representer.rb@@ -396,19 +396,14 @@ module APIproperty :duration,exec_context: :decorator,- if: ->(represented:, **) {- !represented.milestone? && OpenProject::FeatureDecisions.work_packages_duration_field_active?- },+ if: ->(represented:, **) { !represented.milestone? },getter: ->(*) dodatetime_formatter.format_duration_from_hours(represented.duration_in_hours,allow_nil: true)end,render_nil: true- property :ignore_non_working_days,- if: ->(*) {- OpenProject::FeatureDecisions.work_packages_duration_field_active?- }+ property :ignore_non_working_daysproperty :spent_time,exec_context: :decorator,diff --git a/lib/open_project/feature_decisions.rb b/lib/open_project/feature_decisions.rbindex 8342538e533..28e95e8d0a1 100644--- a/lib/open_project/feature_decisions.rb+++ b/lib/open_project/feature_decisions.rb@@ -39,10 +39,5 @@ module OpenProject# release_date = Date.new(2022,01,01)# Setting.feature_your_module_active || Date.today > release_date# end-- # TODO: remove this feature flag- def self.work_packages_duration_field_active?- true- endendenddiff --git a/lib_static/plugins/acts_as_journalized/lib/journal_changes.rb b/lib_static/plugins/acts_as_journalized/lib/journal_changes.rbindex b9e17666c6e..ff511baf457 100644--- a/lib_static/plugins/acts_as_journalized/lib/journal_changes.rb+++ b/lib_static/plugins/acts_as_journalized/lib/journal_changes.rb@@ -37,8 +37,6 @@ module JournalChangessubsequent_journal_data_changesend- @changes.delete(:duration) unless OpenProject::FeatureDecisions.work_packages_duration_field_active?-@changes.merge!(get_association_changes(predecessor, 'attachable', 'attachments', :attachment_id, :filename))@changes.merge!(get_association_changes(predecessor, 'customizable', 'custom_fields', :custom_field_id, :value))enddiff --git a/modules/bim/spec/seeders/demo_data_seeder_spec.rb b/modules/bim/spec/seeders/demo_data_seeder_spec.rbindex 1a4422d3219..c48719b15fd 100644--- a/modules/bim/spec/seeders/demo_data_seeder_spec.rb+++ b/modules/bim/spec/seeders/demo_data_seeder_spec.rb@@ -31,8 +31,7 @@ require 'spec_helper'describe RootSeeder,'BIM edition',with_config: { edition: 'bim' },- with_settings: { journal_aggregation_time_minutes: 0 },- with_flag: { work_packages_duration_field_active: true } do+ with_settings: { journal_aggregation_time_minutes: 0 } doit 'create the demo data' doexpect { described_class.new.do_seed! }.not_to raise_errordiff --git a/modules/storages/spec/seeders/seeder_spec.rb b/modules/storages/spec/seeders/seeder_spec.rbindex 825a5e81d90..b33deecce38 100644--- a/modules/storages/spec/seeders/seeder_spec.rb+++ b/modules/storages/spec/seeders/seeder_spec.rb@@ -28,8 +28,7 @@require 'spec_helper'-describe RootSeeder, 'Storage module',- with_flag: { work_packages_duration_field_active: true } do+describe RootSeeder, 'Storage module' doit 'seeds role permissions for Storages' doexpect { described_class.new.do_seed! }.not_to raise_errordiff --git a/spec/contracts/work_packages/base_contract_spec.rb b/spec/contracts/work_packages/base_contract_spec.rbindex 38be97e26cd..51c512a9636 100644--- a/spec/contracts/work_packages/base_contract_spec.rb+++ b/spec/contracts/work_packages/base_contract_spec.rb@@ -451,8 +451,7 @@ describe WorkPackages::BaseContract doendend- context 'when setting due date and duration without start date',- with_flag: { work_packages_duration_field_active: true } do+ context 'when setting due date and duration without start date' dobefore dowork_package.duration = 1work_package.start_date = nil@@ -514,8 +513,7 @@ describe WorkPackages::BaseContract doendend- context 'when setting start date and duration without due date',- with_flag: { work_packages_duration_field_active: true } do+ context 'when setting start date and duration without due date' dobefore dowork_package.duration = 1work_package.start_date = Time.zone.today@@ -526,7 +524,7 @@ describe WorkPackages::BaseContract doendend- describe 'duration', with_flag: { work_packages_duration_field_active: true } do+ describe 'duration' docontext 'when setting duration' dobefore dowork_package.duration = 5@@ -565,14 +563,6 @@ describe WorkPackages::BaseContract doit_behaves_like 'contract is valid'end- context 'when setting duration with the feature disabled', with_flag: { work_packages_duration_field_active: false } do- before do- work_package.duration = 5- end-- it_behaves_like 'contract is invalid', duration: :error_readonly- end-context 'when setting duration to 0' dobefore dowork_package.duration = 0@@ -678,7 +668,7 @@ describe WorkPackages::BaseContract doenddescribe 'ignore_non_working_days' do- context 'when setting the value to true', with_flag: { work_packages_duration_field_active: true } do+ context 'when setting the value to true' dobefore dowork_package.ignore_non_working_days = trueend@@ -686,22 +676,13 @@ describe WorkPackages::BaseContract doit_behaves_like 'contract is valid'end- context 'when setting the value to false', with_flag: { work_packages_duration_field_active: true } do+ context 'when setting the value to false' dobefore dowork_package.ignore_non_working_days = falseendit_behaves_like 'contract is valid'end-- context 'when setting the value to true and with the feature disabled',- with_flag: { work_packages_duration_field_active: false } do- before do- work_package.ignore_non_working_days = true- end-- it_behaves_like 'contract is invalid', ignore_non_working_days: :error_readonly- endenddescribe 'percentage done' dodiff --git a/spec/features/projects/template_spec.rb b/spec/features/projects/template_spec.rbindex 1f60542acbf..9a22eb06db0 100644--- a/spec/features/projects/template_spec.rb+++ b/spec/features/projects/template_spec.rb@@ -86,8 +86,7 @@ describe 'Project templates', type: :feature, js: true dologin_as current_userend- it 'can instantiate the project with the copy permission',- with_flag: { work_packages_duration_field_active: true } do+ it 'can instantiate the project with the copy permission' dovisit new_project_pathname_field.set_value 'Foo bar'diff --git a/spec/features/work_packages/datepicker/datepicker_logic_spec.rb b/spec/features/work_packages/datepicker/datepicker_logic_spec.rbindex 172993b2689..bfce6b4c987 100644--- a/spec/features/work_packages/datepicker/datepicker_logic_spec.rb+++ b/spec/features/work_packages/datepicker/datepicker_logic_spec.rb@@ -31,7 +31,6 @@ require 'support/edit_fields/edit_field'describe 'Datepicker modal logic test cases (WP #43539)',with_settings: { date_format: '%Y-%m-%d' },- with_flag: { work_packages_duration_field_active: true },js: true doshared_let(:user) { create :admin }@@ -39,8 +38,8 @@ describe 'Datepicker modal logic test cases (WP #43539)',shared_let(:type_milestone) { create(:type_milestone) }shared_let(:project) { create(:project, types: [type_bug, type_milestone]) }- shared_let(:bug_wp) { create :work_package, project:, type: type_bug, ignore_non_working_days: false }- shared_let(:milestone_wp) { create :work_package, project:, type: type_milestone, ignore_non_working_days: false }+ shared_let(:bug_wp) { create :work_package, project:, type: type_bug }+ shared_let(:milestone_wp) { create :work_package, project:, type: type_milestone }# assume sat+sun are non working daysshared_let(:weekdays) { create :week_days }diff --git a/spec/features/work_packages/details/date_editor_spec.rb b/spec/features/work_packages/details/date_editor_spec.rbindex 516d0c7f4ca..842873900fc 100644--- a/spec/features/work_packages/details/date_editor_spec.rb+++ b/spec/features/work_packages/details/date_editor_spec.rb@@ -35,7 +35,6 @@ require 'features/work_packages/work_packages_page'describe 'date inplace editor',with_settings: { date_format: '%Y-%m-%d' },- with_flag: { work_packages_duration_field_active: true },js: true, selenium: true dolet(:project) { create :project_with_types, public: true }let(:work_package) { create :work_package, project:, start_date: Date.parse('2016-01-02'), duration: nil }diff --git a/spec/features/work_packages/edit_work_package_spec.rb b/spec/features/work_packages/edit_work_package_spec.rbindex 4cca4f12d12..4b58bf9e742 100644--- a/spec/features/work_packages/edit_work_package_spec.rb+++ b/spec/features/work_packages/edit_work_package_spec.rb@@ -2,7 +2,6 @@ require 'spec_helper'require 'features/page_objects/notification'describe 'edit work package',- with_flag: { work_packages_duration_field_active: true },js: true dolet(:dev_role) docreate :role,diff --git a/spec/features/work_packages/new/new_work_package_datepicker_spec.rb b/spec/features/work_packages/new/new_work_package_datepicker_spec.rbindex 3631e7b4732..9f4c30baa2a 100644--- a/spec/features/work_packages/new/new_work_package_datepicker_spec.rb+++ b/spec/features/work_packages/new/new_work_package_datepicker_spec.rb@@ -35,7 +35,6 @@ require 'features/work_packages/work_packages_page'describe 'New work package datepicker',with_settings: { date_format: '%Y-%m-%d' },- with_flag: { work_packages_duration_field_active: true },js: true, selenium: true dolet(:project) { create :project_with_types, public: true }let(:user) { create :admin }diff --git a/spec/features/work_packages/scheduling/scheduling_mode_spec.rb b/spec/features/work_packages/scheduling/scheduling_mode_spec.rbindex 9ded7b90885..be4c71a6929 100644--- a/spec/features/work_packages/scheduling/scheduling_mode_spec.rb+++ b/spec/features/work_packages/scheduling/scheduling_mode_spec.rb@@ -34,7 +34,6 @@ require 'support/edit_fields/edit_field'require 'features/work_packages/work_packages_page'describe 'scheduling mode',- with_flag: { work_packages_duration_field_active: true },js: true dolet(:project) { create :project_with_types, public: true }# Constructing a work package graph that looks like this:diff --git a/spec/features/work_packages/table/duration_field_spec.rb b/spec/features/work_packages/table/duration_field_spec.rbindex bc74e137f78..55620fddacb 100644--- a/spec/features/work_packages/table/duration_field_spec.rb+++ b/spec/features/work_packages/table/duration_field_spec.rb@@ -1,7 +1,6 @@require 'spec_helper'describe 'Duration field in the work package table',- with_flag: { work_packages_duration_field_active: true },js: true doshared_let(:current_user) { create :admin }shared_let(:work_package) dodiff --git a/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb b/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rbindex dc97b30b9e6..180793edde9 100644--- a/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb+++ b/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb@@ -293,7 +293,7 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter doendend- describe 'duration', with_flag: { work_packages_duration_field_active: true } do+ describe 'duration' dolet(:milestone?) { false }before do@@ -317,12 +317,6 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter doexpect(subject).not_to have_json_path('duration')endend-- context 'when the feature flag is off', with_flag: { work_packages_duration_field_active: false } do- it 'has no duration attribute' do- expect(subject).not_to have_json_path('duration')- end- endenddescribe 'scheduleManually' do@@ -336,7 +330,7 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter doendend- describe 'ignoreNonWorkingDays', with_flag: { work_packages_duration_field_active: true } do+ describe 'ignoreNonWorkingDays' doit_behaves_like 'has basic schema properties' dolet(:path) { 'ignoreNonWorkingDays' }let(:type) { 'Boolean' }@@ -344,12 +338,6 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter dolet(:required) { false }let(:writable) { true }end-- context 'when the feature flag is off', with_flag: { work_packages_duration_field_active: false } do- it 'has no ignoreNonWorkingDays attribute' do- expect(subject).not_to have_json_path('ignoreNonWorkingDays')- end- endenddescribe 'date' dodiff --git a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb b/spec/lib/api/v3/work_packages/work_package_representer_spec.rbindex 8ecb112cfcf..18d19caee0c 100644--- a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb+++ b/spec/lib/api/v3/work_packages/work_package_representer_spec.rb@@ -298,7 +298,7 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter doendend- describe 'duration', with_flag: { work_packages_duration_field_active: true } do+ describe 'duration' dolet(:duration) { 6 }it { is_expected.to be_json_eql('P6D'.to_json).at_path('duration') }@@ -318,15 +318,9 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter doexpect(subject).not_to have_json_path('duration')endend-- context 'when the feature flag is off', with_flag: { work_packages_duration_field_active: false } do- it 'with no duration' do- expect(subject).not_to have_json_path('duration')- end- endend- describe 'ignoreNonWorkingDays', with_flag: { work_packages_duration_field_active: true } do+ describe 'ignoreNonWorkingDays' dolet(:ignore_non_working_days) { true }context 'with the value being `true`' do@@ -338,12 +332,6 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter doit { is_expected.to be_json_eql(false.to_json).at_path('ignoreNonWorkingDays') }end-- context 'when the feature flag is off', with_flag: { work_packages_duration_field_active: false } do- it 'has no ignoreNonWorkingDays' do- expect(subject).not_to have_json_path('ignoreNonWorkingDays')- end- endenddescribe 'createdAt' do@@ -1388,7 +1376,7 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter doenddescribe 'parsing' do- describe 'duration', with_flag: { work_packages_duration_field_active: true } do+ describe 'duration' dosubject { representer }it 'parses form iso8601 format' dodiff --git a/spec/models/mail_handler_spec.rb b/spec/models/mail_handler_spec.rbindex 2d4a563fafa..0250e3fd059 100644--- a/spec/models/mail_handler_spec.rb+++ b/spec/models/mail_handler_spec.rb@@ -785,7 +785,7 @@ describe MailHandler, type: :model do.to include 'The text of the reply.'end- it 'alters the attributes', with_flag: { work_packages_duration_field_active: true } do+ it 'alters the attributes' dosubjectexpect(work_package.journals.reload.last.details)diff --git a/spec/models/queries/work_packages/columns/property_column_spec.rb b/spec/models/queries/work_packages/columns/property_column_spec.rbindex 5465336bc79..82958fe55c6 100644--- a/spec/models/queries/work_packages/columns/property_column_spec.rb+++ b/spec/models/queries/work_packages/columns/property_column_spec.rb@@ -55,13 +55,7 @@ describe Queries::WorkPackages::Columns::PropertyColumn, type: :model doendend- context 'when duration feature flag disabled', with_flag: { work_packages_duration_field_active: false } do- it 'column does not exist' do- expect(described_class.instances.map(&:name)).not_to include :duration- end- end-- context 'when duration feature flag enabled', with_flag: { work_packages_duration_field_active: true } do+ context 'when duration feature flag enabled' doit 'column exists' doexpect(described_class.instances.map(&:name)).to include :durationenddiff --git a/spec/models/type_spec.rb b/spec/models/type_spec.rbindex ae45715e472..6338d444620 100644--- a/spec/models/type_spec.rb+++ b/spec/models/type_spec.rb@@ -113,28 +113,16 @@ describe ::Type, type: :model dodescribe '#work_package_attributes' dosubject { type.work_package_attributes }- context 'for the duration field', with_flag: { work_packages_duration_field_active: true } do- it 'does not return true field' do+ context 'for the duration field' do+ it 'does not return the field' doexpect(subject).not_to have_key("duration")end-- context 'when the feature flag is off', with_flag: { work_packages_duration_field_active: false } do- it 'does not return the field' do- expect(subject).not_to have_key("duration")- end- endend- context 'for the ignore_non_working_days field', with_flag: { work_packages_duration_field_active: true } do- it 'does not return duration' do+ context 'for the ignore_non_working_days field' do+ it 'does not return the field' doexpect(subject).not_to have_key("ignore_non_working_days")end-- context 'when the feature flag is off', with_flag: { work_packages_duration_field_active: false } do- it 'does not return the duration field' do- expect(subject).not_to have_key("ignore_non_working_days")- end- endendendenddiff --git a/spec/models/work_package/work_package_acts_as_journalized_spec.rb b/spec/models/work_package/work_package_acts_as_journalized_spec.rbindex 5fed47b71be..21d9c161b28 100644--- a/spec/models/work_package/work_package_acts_as_journalized_spec.rb+++ b/spec/models/work_package/work_package_acts_as_journalized_spec.rb@@ -179,7 +179,7 @@ describe WorkPackage, type: :model dowork_package.save!end- context 'for last created journal', with_flag: { work_packages_duration_field_active: true } do+ context 'for last created journal' dosubject { work_package.journals.reload.last.details }it 'contains all changes' do@@ -189,16 +189,6 @@ describe WorkPackage, type: :model doexpect(subject).to have_key(a.to_s), "Missing change for #{a}"endend-- context 'when duration feature flag is inactive', with_flag: { work_packages_duration_field_active: false } do- it 'contains all changes' do- %i(subject description type_id status_id priority_id- start_date due_date estimated_hours assigned_to_id- responsible_id parent_id schedule_manually).each do |a|- expect(subject).to have_key(a.to_s), "Missing change for #{a}"- end- end- endendshared_examples_for 'old value' do@@ -246,7 +236,7 @@ describe WorkPackage, type: :model doendend- describe 'duration', with_flag: { work_packages_duration_field_active: true } do+ describe 'duration' dolet(:property) { 'duration' }context 'for old value' do@@ -260,22 +250,6 @@ describe WorkPackage, type: :model doit_behaves_like 'new value'end-- context 'when duration feature flag is inactive', with_flag: { work_packages_duration_field_active: false } do- let(:property) { 'duration' }-- context 'for old value' do- let(:expected_value) { nil }-- it_behaves_like 'old value'- end-- context 'for new value' do- let(:expected_value) { nil }-- it_behaves_like 'new value'- end- endendenddiff --git a/spec/seeders/demo_data_seeder_spec.rb b/spec/seeders/demo_data_seeder_spec.rbindex a2c7b0ca866..e594cc86f4f 100644--- a/spec/seeders/demo_data_seeder_spec.rb+++ b/spec/seeders/demo_data_seeder_spec.rb@@ -31,8 +31,7 @@ require 'spec_helper'describe RootSeeder,'standard edition',with_config: { edition: 'standard' },- with_settings: { journal_aggregation_time_minutes: 0 },- with_flag: { work_packages_duration_field_active: true } do+ with_settings: { journal_aggregation_time_minutes: 0 } dobefore doallow($stdout).to receive(:puts) { |msg| Rails.logger.info(msg) }enddiff --git a/spec/services/work_packages/schedule_dependency/dependency_spec.rb b/spec/services/work_packages/schedule_dependency/dependency_spec.rbindex 42142d00fdd..60b0f1eeb3e 100644--- a/spec/services/work_packages/schedule_dependency/dependency_spec.rb+++ b/spec/services/work_packages/schedule_dependency/dependency_spec.rb@@ -233,11 +233,11 @@ RSpec.describe WorkPackages::ScheduleDependency::Dependency doendend- context 'with non working days', with_flag: { work_packages_duration_field_active: true } do+ context 'with non working days' dolet!(:tomorrow_we_do_not_work!) { create(:non_working_day, date: Time.zone.tomorrow) }it 'returns the soonest start date being a working day' do- follower = create_follower_of(work_package, ignore_non_working_days: false)+ follower = create_follower_of(work_package)expect(dependency_for(follower).soonest_start_date).to eq(work_package.due_date + 2.days)endenddiff --git a/spec/services/work_packages/set_attributes_service_spec.rb b/spec/services/work_packages/set_attributes_service_spec.rbindex 405323ae536..228c4ac4f0e 100644--- a/spec/services/work_packages/set_attributes_service_spec.rb+++ b/spec/services/work_packages/set_attributes_service_spec.rb@@ -29,8 +29,7 @@require 'spec_helper'describe WorkPackages::SetAttributesService,- type: :model,- with_flag: { work_packages_duration_field_active: true } do+ type: :model dolet(:today) { Time.zone.today }let(:user) { build_stubbed(:user) }let(:project) do@@ -1051,7 +1050,7 @@ describe WorkPackages::SetAttributesService,context 'when start date changes' dolet(:work_package) do- build_stubbed(:work_package, start_date: monday, due_date: next_monday, ignore_non_working_days: false)+ build_stubbed(:work_package, start_date: monday, due_date: next_monday)endlet(:call_attributes) { { start_date: wednesday } }@@ -1067,7 +1066,7 @@ describe WorkPackages::SetAttributesService,context 'when due date changes' dolet(:work_package) do- build_stubbed(:work_package, start_date: monday, due_date: next_monday, ignore_non_working_days: false)+ build_stubbed(:work_package, start_date: monday, due_date: next_monday)endlet(:call_attributes) { { due_date: monday + 14.days } }@@ -1083,7 +1082,7 @@ describe WorkPackages::SetAttributesService,context 'when duration changes' dolet(:work_package) do- build_stubbed(:work_package, start_date: monday, due_date: next_monday, ignore_non_working_days: false)+ build_stubbed(:work_package, start_date: monday, due_date: next_monday)endlet(:call_attributes) { { duration: "13" } }@@ -1099,7 +1098,7 @@ describe WorkPackages::SetAttributesService,context 'when duration and end_date both change' dolet(:work_package) do- build_stubbed(:work_package, start_date: monday, due_date: next_monday, ignore_non_working_days: false)+ build_stubbed(:work_package, start_date: monday, due_date: next_monday)endlet(:call_attributes) { { due_date: next_tuesday, duration: 4 } }diff --git a/spec/services/work_packages/set_schedule_service_working_days_spec.rb b/spec/services/work_packages/set_schedule_service_working_days_spec.rbindex 2ffd1316f3a..7a1d43b6941 100644--- a/spec/services/work_packages/set_schedule_service_working_days_spec.rb+++ b/spec/services/work_packages/set_schedule_service_working_days_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_packages_duration_field_active: true } do+describe WorkPackages::SetScheduleService, 'working days' docreate_shared_association_defaults_for_work_package_factoryshared_let(:week_days) { create(:week_days) }@@ -42,7 +42,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'with a single successor' docontext 'when moving successor will cover non-working days' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | XXX | follows work_package@@ -66,7 +66,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moved predecessor covers non-working days' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | XXX | follows work_package@@ -91,7 +91,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'when predecessor moved forward' docontext 'on a day in the middle on working days with the follower having only start date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | X |follower | [ | follows work_package@@ -114,7 +114,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'on a day just before non working days with the follower having only start date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | X |follower | [ | follows work_package@@ -137,7 +137,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'on a day in the middle of working days with the follower having only due date and no space in between' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | ] | follows work_package@@ -160,7 +160,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'on a day in the middle of working days with the follower having only due date and much space in between' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSmt |work_package | ] |follower | ] | follows work_package@@ -183,7 +183,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'on a day just before non-working day with the follower having only due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | ] | follows work_package@@ -206,7 +206,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the follower having some space left' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | X |follower | X..XX | follows work_package@@ -229,7 +229,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the follower having enough space left to not be moved at all' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | X |follower | XXX | follows work_package@@ -252,7 +252,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the follower having some space left and a delay' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSmtwtfss |work_package | X |follower | XXX | follows work_package with delay 3@@ -277,7 +277,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'when predecessor moved backwards' docontext 'on a day right before some non-working days' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | X |follower | XX | follows work_package@@ -300,7 +300,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'on a day in the middle of working days' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | X |follower | XX | follows work_package@@ -323,7 +323,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'on a day before non-working days the follower having space between' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | X |follower | X | follows work_package@@ -346,7 +346,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the follower having another relation limiting movement' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | mtwtfssmtwtfssMTWTFSS |work_package | X |follower | XX | follows work_package, follows annoyer with delay 2@@ -370,7 +370,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the follower having another relation limiting movement and only due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | mtwtfssmtwtfssMTWTFSS |work_package | X |follower | ] | follows work_package, follows annoyer with delay 2@@ -396,7 +396,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'when removing the dates on the moved predecessor' docontext 'with the follower having start and due dates' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | XXX | follows work_package@@ -419,7 +419,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the follower having only a due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | ] | follows work_package@@ -444,7 +444,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'when only creating the relation between predecessor and follower' docontext 'with follower having no dates' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | |@@ -464,7 +464,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with follower having only due date before predecessor due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | ] |@@ -484,7 +484,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with follower having only start date before predecessor due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | [ |@@ -504,7 +504,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with follower having both start and due dates before predecessor due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | mtwtfssMTWTFSS |work_package | XX |follower | X..XXX |@@ -524,7 +524,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with follower having due date long after predecessor due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |follower | ] |@@ -544,7 +544,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with predecessor and follower having no dates' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | |follower | |@@ -565,7 +565,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'with the successor having another predecessor which has no dates' docontext 'when moved forward' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XXX | follows work_package, follows other_predecessor@@ -589,7 +589,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moved backwards' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XXX | follows work_package, follows other_predecessor@@ -615,7 +615,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with a parent' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |parent | |work_package | ] | child of parent@@ -638,7 +638,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with a parent having a follower' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |parent | XX |work_package | ] | child of parent@@ -664,7 +664,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'with a single successor having a parent' docontext 'when moving forward' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XX | follows work_package, child of follower_parent@@ -689,7 +689,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving forward with the parent having another child not being moved' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XX | follows work_package, child of follower_parent@@ -715,7 +715,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving backwards' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XX | follows work_package, child of follower_parent@@ -740,7 +740,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving backwards with the parent having a predecessor limiting movement' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | mtwtfssMTWTFSS |work_package | ] |follower | XX | follows work_package, child of follower_parent@@ -766,7 +766,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving backwards with the parent having another relation not limiting movement' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | mtwtfssMTWTFSS |work_package | ] |follower | XXXX | follows work_package, child of follower_parent@@ -792,7 +792,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving backwards with the parent having another child not being moved' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | mtwtfssMTWTFSS |work_package | ] |follower | XX | follows work_package, child of follower_parent@@ -820,7 +820,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'with a single successor having a child' docontext 'when moving forward' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XX | follows work_package@@ -847,7 +847,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'with a single successor having two children' docontext 'when creating the follows relation while follower starts 1 day after moved due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XXXX..XXXXX..XX |@@ -868,7 +868,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when creating the follows relation while follower starts 3 days after moved due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XX..XXXXX..XXXX |@@ -889,7 +889,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when creating the follows relation and follower first child starts before moved due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | X..XXXXX..XXXX |@@ -912,7 +912,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when creating the follows relation and both follower children start before moved due date' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |follower | XXX..XXXXX..X |@@ -938,7 +938,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'with a chain of followers' docontext 'when moving forward' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSm sm sm |work_package | ] |follower1 | XXX | follows work_package@@ -967,7 +967,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving forward with some space between the followers' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSm sm sm |work_package | ] |follower1 | XXX | follows work_package@@ -994,7 +994,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving forward with some delay and spaces between the followers' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSm sm sm |work_package | ] |follower1 | XXX | follows work_package@@ -1023,7 +1023,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving backwards' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSm sm sm |work_package | ] |follower1 | XXX | follows work_package@@ -1054,7 +1054,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paccontext 'with a chain of followers with two paths leading to the same follower in the end' docontext 'when moving forward' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSm sm |work_package | ] |follower1 | XXX | follows work_package@@ -1083,7 +1083,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'when moving backwards' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSSm sm |work_package | ] |follower1 | XXX | follows work_package@@ -1116,7 +1116,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_paclet(:changed_attributes) { [:parent] }context 'without dates and with the parent being restricted in its ability to be moved' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | |new_parent | | follows new_parent_predecessor with delay 3@@ -1138,7 +1138,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'without dates, with a duration and with the parent being restricted in its ability to be moved' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | | duration 4new_parent | | follows new_parent_predecessor with delay 3@@ -1161,7 +1161,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the parent being restricted in its ability to be moved and with a due date before parent constraint' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |new_parent | | follows new_parent_predecessor with delay 3@@ -1183,7 +1183,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the parent being restricted in its ability to be moved and with a due date after parent constraint' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | ] |new_parent | | follows new_parent_predecessor with delay 3@@ -1205,7 +1205,7 @@ describe WorkPackages::SetScheduleService, 'working days', with_flag: { work_pacendcontext 'with the parent being restricted but work package already has both dates set' do- let_schedule(<<~CHART, ignore_non_working_days: false)+ let_schedule(<<~CHART)days | MTWTFSS |work_package | XX |new_parent | | follows new_parent_predecessor with delay 3diff --git a/spec/services/work_packages/shared/all_days_spec.rb b/spec/services/work_packages/shared/all_days_spec.rbindex 2d5eb0ded77..7889298dae6 100644--- a/spec/services/work_packages/shared/all_days_spec.rb+++ b/spec/services/work_packages/shared/all_days_spec.rb@@ -54,28 +54,16 @@ RSpec.describe WorkPackages::Shared::AllDays doinclude_examples 'it returns duration', 365 * 2, Date.new(2022, 1, 1), Date.new(2023, 12, 31)end- context 'without start date', with_flag: { work_packages_duration_field_active: true } do+ context 'without start date' doit 'returns nil' doexpect(subject.duration(nil, sunday_2022_07_31)).to be_nilend-- context 'when work packages duration field is inactive', with_flag: { work_packages_duration_field_active: false } do- it 'returns 1' do- expect(subject.duration(nil, sunday_2022_07_31)).to eq(1)- end- endend- context 'without due date', with_flag: { work_packages_duration_field_active: true } do+ context 'without due date' doit 'returns nil' doexpect(subject.duration(sunday_2022_07_31, nil)).to be_nilend-- context 'when work packages duration field is inactive', with_flag: { work_packages_duration_field_active: false } do- it 'returns 1' do- expect(subject.duration(sunday_2022_07_31, nil)).to eq(1)- end- endendenddiff --git a/spec/services/work_packages/shared/days_spec.rb b/spec/services/work_packages/shared/days_spec.rbindex af2a5a5896e..f6f11f0c0cd 100644--- a/spec/services/work_packages/shared/days_spec.rb+++ b/spec/services/work_packages/shared/days_spec.rb@@ -31,7 +31,7 @@ require 'rails_helper'RSpec.describe WorkPackages::Shared::Days dosubject { described_class.new }- describe '.for', with_flag: { work_packages_duration_field_active: true } do+ describe '.for' docontext 'for a work_package ignoring non working days' dolet(:work_package) { build_stubbed(:work_package, ignore_non_working_days: true) }@@ -41,24 +41,11 @@ RSpec.describe WorkPackages::Shared::Days doendcontext 'for a work_package respecting non working days' do- let(:work_package) { build_stubbed(:work_package, ignore_non_working_days: false) }+ let(:work_package) { build_stubbed(:work_package) }it 'returns a WorkingDays instance' doexpect(described_class.for(work_package)).to be_an_instance_of(WorkPackages::Shared::WorkingDays)endend-- context 'when work packages duration field is inactive', with_flag: { work_packages_duration_field_active: false } do- it 'always returns an AllDays instance' do- work_package = build_stubbed(:work_package)- expect(described_class.for(work_package)).to be_an_instance_of(WorkPackages::Shared::AllDays)-- work_package = build_stubbed(:work_package, ignore_non_working_days: true)- expect(described_class.for(work_package)).to be_an_instance_of(WorkPackages::Shared::AllDays)-- work_package = build_stubbed(:work_package, ignore_non_working_days: false)- expect(described_class.for(work_package)).to be_an_instance_of(WorkPackages::Shared::AllDays)- end- endendenddiff --git a/spec/services/work_packages/shared/working_days_spec.rb b/spec/services/work_packages/shared/working_days_spec.rbindex bb8e74ae1b9..ef49a869693 100644--- a/spec/services/work_packages/shared/working_days_spec.rb+++ b/spec/services/work_packages/shared/working_days_spec.rb@@ -78,28 +78,16 @@ RSpec.describe WorkPackages::Shared::WorkingDays doinclude_examples 'it returns duration', 8, Date.new(2022, 12, 24), Date.new(2023, 1, 2)end- context 'without start date', with_flag: { work_packages_duration_field_active: true } do+ context 'without start date' doit 'returns nil' doexpect(subject.duration(nil, sunday_2022_07_31)).to be_nilend-- context 'when work packages duration field is inactive', with_flag: { work_packages_duration_field_active: false } do- it 'returns 1' do- expect(subject.duration(nil, sunday_2022_07_31)).to eq(1)- end- endend- context 'without due date', with_flag: { work_packages_duration_field_active: true } do+ context 'without due date' doit 'returns nil' doexpect(subject.duration(sunday_2022_07_31, nil)).to be_nilend-- context 'when work packages duration field is inactive', with_flag: { work_packages_duration_field_active: false } do- it 'returns 1' do- expect(subject.duration(sunday_2022_07_31, nil)).to eq(1)- end- endendenddiff --git a/spec/services/work_packages/update_service_integration_spec.rb b/spec/services/work_packages/update_service_integration_spec.rbindex b088161ed13..6d5ae3abe22 100644--- a/spec/services/work_packages/update_service_integration_spec.rb+++ b/spec/services/work_packages/update_service_integration_spec.rb@@ -901,8 +901,7 @@ 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)',- with_flag: { work_packages_duration_field_active: true } do+ describe 'rescheduling work packages with a parent having a follows relation (Regression #43220)' dolet(:predecessor_work_package_attributes) dowork_package_attributes.merge(start_date: Time.zone.today + 1.day,diff --git a/spec/support_spec/schedule_helpers/chart_spec.rb b/spec/support_spec/schedule_helpers/chart_spec.rbindex 7941e2f0206..d2c05055828 100644--- a/spec/support_spec/schedule_helpers/chart_spec.rb+++ b/spec/support_spec/schedule_helpers/chart_spec.rb@@ -156,7 +156,7 @@ describe ScheduleHelpers::Chart doendend- describe '#to_s', with_flag: { work_packages_duration_field_active: true } do+ describe '#to_s' dolet!(:week_days) { create(:week_days) }context 'with a chart built from ascii representation' do