You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
548 B

  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