From d6887ff2b07149f0ccf0e6f3ad0c5e04ead0b9c0 Mon Sep 17 00:00:00 2001 From: Anton-Ivanov Date: Tue, 7 Jan 2025 22:35:38 +0200 Subject: [PATCH] #1634, AsyncBatchDestroyJob failed on account delete --- spec/jobs/async_batch_destroy_job_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/jobs/async_batch_destroy_job_spec.rb b/spec/jobs/async_batch_destroy_job_spec.rb index 2b20916c5..48d43ddc5 100644 --- a/spec/jobs/async_batch_destroy_job_spec.rb +++ b/spec/jobs/async_batch_destroy_job_spec.rb @@ -93,6 +93,20 @@ end end end + + context 'context' do + let(:model_class) { 'Account' } + let(:sql_query) { Account.all.to_sql } + + before do + account = FactoryBot.create(:account, :with_customer) + FactoryBot.create(:rate_management_pricelist_item, :with_pricelist, account: account) + end + + it 'should' do + expect { subject }.to change(Account, :count).by(-1) + end + end end end end