about summary refs log tree commit diff
path: root/spec/workers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-12-17 23:01:21 +0100
committerGitHub <noreply@github.com>2021-12-17 23:01:21 +0100
commit7f803c41e2ca54b7b787b1f111f91357136c0e68 (patch)
tree4583b08c706ac25f05be5dc2908d52a55a71c81a /spec/workers
parent0c17fd91091fd2f230224d5fce218688d480502c (diff)
Add ability to purge undeliverable domains from admin interface (#16686)
* Add ability to purge undeliverable domains from admin interface

* Add tests
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/admin/domain_purge_worker_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/workers/admin/domain_purge_worker_spec.rb b/spec/workers/admin/domain_purge_worker_spec.rb
new file mode 100644
index 000000000..b67c58b23
--- /dev/null
+++ b/spec/workers/admin/domain_purge_worker_spec.rb
@@ -0,0 +1,18 @@
+# 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
+      service = double(call: nil)
+      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