2021-12-17 22:01:21 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 05:12:25 +00:00
|
|
|
RSpec.describe Admin::DomainPurgeWorker do
|
2021-12-17 22:01:21 +00:00
|
|
|
subject { described_class.new }
|
|
|
|
|
|
|
|
describe 'perform' do
|
|
|
|
it 'calls domain purge service for relevant domain block' do
|
2023-06-22 12:55:22 +00:00
|
|
|
service = instance_double(PurgeDomainService, call: nil)
|
2021-12-17 22:01:21 +00: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
|