diff options
Diffstat (limited to 'spec/services/design_management')
-rw-r--r-- | spec/services/design_management/delete_designs_service_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/design_management/delete_designs_service_spec.rb b/spec/services/design_management/delete_designs_service_spec.rb index 341f71fa62c..bc7625d7c28 100644 --- a/spec/services/design_management/delete_designs_service_spec.rb +++ b/spec/services/design_management/delete_designs_service_spec.rb @@ -149,6 +149,12 @@ RSpec.describe DesignManagement::DeleteDesignsService do expect { run_service } .to change { designs.first.deleted? }.from(false).to(true) end + + it 'schedules deleting todos for that design' do + expect(TodosDestroyer::DestroyedDesignsWorker).to receive(:perform_async).with([designs.first.id]) + + run_service + end end context 'more than one design is passed' do @@ -168,6 +174,12 @@ RSpec.describe DesignManagement::DeleteDesignsService do .and change { Event.destroyed_action.for_design.count }.by(2) end + it 'schedules deleting todos for that design' do + expect(TodosDestroyer::DestroyedDesignsWorker).to receive(:perform_async).with(designs.map(&:id)) + + run_service + end + it_behaves_like "a success" context 'after executing the service' do |