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