Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-10-04 17:26:56 +0300
committerShinya Maeda <shinya@gitlab.com>2017-10-04 17:26:56 +0300
commit8d9d0f9401269a5718da9d22a1863a4c4ab5f36e (patch)
tree58259553e2aa341f34175c439a788135237efe70 /spec/workers/wait_for_cluster_creation_worker_spec.rb
parenta644f4b829080d603405c6eee73a88e2be5cf929 (diff)
create_cluster_service_spec. cluster_provision_worker_spec. cluster_queue_spec.
Diffstat (limited to 'spec/workers/wait_for_cluster_creation_worker_spec.rb')
-rw-r--r--spec/workers/wait_for_cluster_creation_worker_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/workers/wait_for_cluster_creation_worker_spec.rb b/spec/workers/wait_for_cluster_creation_worker_spec.rb
new file mode 100644
index 00000000000..753c7efb9af
--- /dev/null
+++ b/spec/workers/wait_for_cluster_creation_worker_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe WaitForClusterCreationWorker do
+ describe '#perform' do
+ context 'when cluster exists' do
+ let(:cluster) { create(:gcp_cluster) }
+
+ it 'fetches gcp operation status' do
+ expect_any_instance_of(Ci::FetchGcpOperationService).to receive(:execute)
+
+ described_class.new.perform(cluster.id)
+ end
+
+ # TODO: context 'when operation.status is runnning'
+ end
+
+ context 'when cluster does not exist' do
+ it 'does not provision a cluster' do
+ expect_any_instance_of(Ci::FetchGcpOperationService).to receive(:execute).with(nil)
+
+ described_class.new.perform(123)
+ end
+ end
+ end
+end