diff --git a/spec/services/relations/create_service_spec.rb b/spec/services/relations/create_service_spec.rb index 9310cacfa23a..2c349e97848d 100644 --- a/spec/services/relations/create_service_spec.rb +++ b/spec/services/relations/create_service_spec.rb @@ -39,11 +39,13 @@ let(:work_package1) do build_stubbed(:work_package, + subject: "work_package1", due_date: work_package1_due_date, start_date: work_package1_start_date) end let(:work_package2) do build_stubbed(:work_package, + subject: "work_package2", due_date: work_package2_due_date, start_date: work_package2_start_date) end @@ -111,7 +113,7 @@ before do expect(WorkPackages::SetScheduleService) .to receive(:new) - .with(user:, work_package: work_package1) + .with(user:, work_package: work_package1, switching_to_automatic_mode: [work_package2]) .and_return(set_schedule_service) expect(set_schedule_service) diff --git a/spec/services/relations/update_service_spec.rb b/spec/services/relations/update_service_spec.rb index 6006b5e9a2be..6f6c6b53e49d 100644 --- a/spec/services/relations/update_service_spec.rb +++ b/spec/services/relations/update_service_spec.rb @@ -39,11 +39,13 @@ let(:work_package1) do build_stubbed(:work_package, + subject: "work_package1", due_date: work_package1_due_date, start_date: work_package1_start_date) end let(:work_package2) do build_stubbed(:work_package, + subject: "work_package2", due_date: work_package2_due_date, start_date: work_package2_start_date) end @@ -107,7 +109,7 @@ before do expect(WorkPackages::SetScheduleService) .to receive(:new) - .with(user:, work_package: work_package1) + .with(user:, work_package: work_package1, switching_to_automatic_mode: []) .and_return(set_schedule_service) expect(set_schedule_service) diff --git a/spec/services/work_packages/set_schedule_service_spec.rb b/spec/services/work_packages/set_schedule_service_spec.rb index 7ddf7e61492b..453f804db727 100644 --- a/spec/services/work_packages/set_schedule_service_spec.rb +++ b/spec/services/work_packages/set_schedule_service_spec.rb @@ -529,9 +529,9 @@ def create_child(parent, start_date, due_date, **attributes) before do allow(WorkPackage) .to receive(:for_scheduling) - .and_wrap_original do |method, *args| + .and_wrap_original do |method, *args, **kwargs| wanted_order = [sibling_follower_of_work_package, follower_of_parent_work_package, parent_work_package] - method.call(*args).in_order_of(:id, wanted_order.map(&:id)) + method.call(*args, **kwargs).in_order_of(:id, wanted_order.map(&:id)) end end