2021-12-18 09:01:21 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 15:12:25 +10:00
|
|
|
RSpec.describe Admin::DomainPurgeWorker do
|
2021-12-18 09:01:21 +11:00
|
|
|
subject { described_class.new }
|
|
|
|
|
|
|
|
describe 'perform' do
|
|
|
|
it 'calls domain purge service for relevant domain block' do
|
2023-06-22 22:55:22 +10:00
|
|
|
service = instance_double(PurgeDomainService, call: nil)
|
2021-12-18 09:01:21 +11:00
|
|
|
allow(PurgeDomainService).to receive(:new).and_return(service)
|
|
|
|
result = subject.perform('example.com')
|
|
|
|
|
|
|
|
expect(result).to be_nil
|
|
|
|
expect(service).to have_received(:call).with('example.com')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|