debian-mirror-gitlab/spec/workers/pages_domain_verification_cron_worker_spec.rb
2019-05-18 00:54:41 +05:30

24 lines
672 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
describe PagesDomainVerificationCronWorker do
subject(:worker) { described_class.new }
describe '#perform' do
it 'enqueues a PagesDomainVerificationWorker for domains needing verification' do
verified = create(:pages_domain)
reverify = create(:pages_domain, :reverify)
disabled = create(:pages_domain, :disabled)
[reverify, disabled].each do |domain|
expect(PagesDomainVerificationWorker).to receive(:perform_async).with(domain.id)
end
expect(PagesDomainVerificationWorker).not_to receive(:perform_async).with(verified.id)
worker.perform
end
end
end