mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-20 00:37:26 +00:00
Running StandingOrderSyncJob when order cycles added to a schedule via OrderCyclesController
This commit is contained in:
@@ -188,6 +188,18 @@ module Admin
|
||||
# coordinated_order_cycle is removed, uncoordinated_order_cycle is NOT added
|
||||
expect(coordinated_order_cycle.reload.schedules).to_not include coordinated_schedule, uncoordinated_schedule
|
||||
end
|
||||
|
||||
it "enqueues a StandingOrderSyncJob when schedule_ids change" do
|
||||
expect do
|
||||
spree_put :update, format: :json, id: coordinated_order_cycle.id, order_cycle: { schedule_ids: [coordinated_schedule.id, coordinated_schedule2.id] }
|
||||
end.to enqueue_job StandingOrderSyncJob
|
||||
expect do
|
||||
spree_put :update, format: :json, id: coordinated_order_cycle.id, order_cycle: { schedule_ids: [coordinated_schedule.id] }
|
||||
end.to enqueue_job StandingOrderSyncJob
|
||||
expect do
|
||||
spree_put :update, format: :json, id: coordinated_order_cycle.id, order_cycle: { schedule_ids: [coordinated_schedule.id] }
|
||||
end.to_not enqueue_job StandingOrderSyncJob
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user