debian-mirror-gitlab/spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb
2020-08-09 17:44:08 +05:30

33 lines
900 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ClusterWaitForIngressIpAddressWorker do
describe '#perform' do
let(:service) { instance_double(Clusters::Applications::CheckIngressIpAddressService, execute: true) }
let(:application) { instance_double(Clusters::Applications::Ingress) }
let(:worker) { described_class.new }
before do
allow(worker)
.to receive(:find_application)
.with('ingress', 117)
.and_yield(application)
allow(Clusters::Applications::CheckIngressIpAddressService)
.to receive(:new)
.with(application)
.and_return(service)
allow(described_class)
.to receive(:perform_in)
end
it 'finds the application and calls CheckIngressIpAddressService#execute' do
worker.perform('ingress', 117)
expect(service).to have_received(:execute)
end
end
end