Skip to content

Commit

Permalink
Fix unit tests broken by previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cbliard committed Dec 17, 2024
1 parent b8c7bb2 commit 176cfaa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion spec/services/relations/create_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion spec/services/relations/update_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions spec/services/work_packages/set_schedule_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 176cfaa

Please sign in to comment.