account_deletion_worker_spec.rb 548 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe Admin::AccountDeletionWorker do
  4. let(:worker) { described_class.new }
  5. describe 'perform' do
  6. let(:account) { Fabricate(:account) }
  7. let(:service) { instance_double(DeleteAccountService, call: true) }
  8. it 'calls delete account service' do
  9. allow(DeleteAccountService).to receive(:new).and_return(service)
  10. worker.perform(account.id)
  11. expect(service).to have_received(:call).with(account, { reserve_email: true, reserve_username: true })
  12. end
  13. end
  14. end