summaryrefslogtreecommitdiff
path: root/spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-03-01 17:38:04 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-03-01 17:38:04 +0000
commitccb080d94aa765d8391f262e25c5ead0764dc2ff (patch)
tree643e50759d3d92617606850ac987507c0ed59774 /spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb
parent52e133d17627396f29c1875b972534eaba4a837e (diff)
parentebac9c81ad1e859afe73482dd6f112b141cf9ede (diff)
downloadgitlab-ce-ccb080d94aa765d8391f262e25c5ead0764dc2ff.tar.gz
Merge branch '42643-persist-external-ip-of-ingress-controller-gke' into 'master'
Display ingress IP address in the Kubernetes page See merge request gitlab-org/gitlab-ce!17052
Diffstat (limited to 'spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb')
-rw-r--r--spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb b/spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb
new file mode 100644
index 00000000000..2e2e9afd25a
--- /dev/null
+++ b/spec/workers/cluster_wait_for_ingress_ip_address_worker_spec.rb
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+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