Some checks failed
Lock Threads / action (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot EE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot EE docker images / merge (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/amd64, ubuntu-latest) (push) Has been cancelled
Publish Chatwoot CE docker images / build (linux/arm64, ubuntu-22.04-arm) (push) Has been cancelled
Publish Chatwoot CE docker images / merge (push) Has been cancelled
Run Chatwoot CE spec / lint-backend (push) Has been cancelled
Run Chatwoot CE spec / lint-frontend (push) Has been cancelled
Run Chatwoot CE spec / frontend-tests (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (0, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (1, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (10, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (11, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (12, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (13, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (14, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (15, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (2, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (3, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (4, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (5, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (6, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (7, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (8, 16) (push) Has been cancelled
Run Chatwoot CE spec / backend-tests (9, 16) (push) Has been cancelled
Run Linux nightly installer / nightly (push) Has been cancelled
- Add Logistics component with progress tracking - Add OrderDetail component for order information - Support data-driven steps and actions - Add blue color scale to widget SCSS - Fix node overflow and progress bar rendering issues - Add English translations for dashboard components Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
45 lines
1.5 KiB
Ruby
45 lines
1.5 KiB
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe Internal::DeleteAccountsJob do
|
|
subject(:job) { described_class.perform_later }
|
|
|
|
let!(:account_marked_for_deletion) { create(:account) }
|
|
let!(:future_deletion_account) { create(:account) }
|
|
let!(:active_account) { create(:account) }
|
|
let(:account_deletion_service) { instance_double(AccountDeletionService, perform: true) }
|
|
|
|
before do
|
|
account_marked_for_deletion.update!(
|
|
custom_attributes: {
|
|
'marked_for_deletion_at' => 1.day.ago.iso8601,
|
|
'marked_for_deletion_reason' => 'user_requested'
|
|
}
|
|
)
|
|
|
|
future_deletion_account.update!(
|
|
custom_attributes: {
|
|
'marked_for_deletion_at' => 3.days.from_now.iso8601,
|
|
'marked_for_deletion_reason' => 'user_requested'
|
|
}
|
|
)
|
|
|
|
allow(AccountDeletionService).to receive(:new).and_return(account_deletion_service)
|
|
end
|
|
|
|
it 'enqueues the job' do
|
|
expect { job }.to have_enqueued_job(described_class)
|
|
.on_queue('scheduled_jobs')
|
|
end
|
|
|
|
describe '#perform' do
|
|
it 'calls AccountDeletionService for accounts past deletion date' do
|
|
described_class.new.perform
|
|
|
|
expect(AccountDeletionService).to have_received(:new).with(account: account_marked_for_deletion)
|
|
expect(AccountDeletionService).not_to have_received(:new).with(account: future_deletion_account)
|
|
expect(AccountDeletionService).not_to have_received(:new).with(account: active_account)
|
|
expect(account_deletion_service).to have_received(:perform)
|
|
end
|
|
end
|
|
end
|