Commit 01de74b6 authored by Matija Čupić's avatar Matija Čupić

Update EE clusters spec with GCP check logic

parent 906cf425
require 'spec_helper' require 'spec_helper'
feature 'EE Clusters' do feature 'EE Clusters' do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
...@@ -75,6 +77,10 @@ feature 'EE Clusters' do ...@@ -75,6 +77,10 @@ feature 'EE Clusters' do
.to receive(:token_in_session).and_return('token') .to receive(:token_in_session).and_return('token')
allow_any_instance_of(Projects::Clusters::GcpController) allow_any_instance_of(Projects::Clusters::GcpController)
.to receive(:expires_at_in_session).and_return(1.hour.since.to_i.to_s) .to receive(:expires_at_in_session).and_return(1.hour.since.to_i.to_s)
stub_google_project_billing_status
allow(CheckGcpProjectBillingWorker).to receive(:perform_async)
allow_any_instance_of(GoogleApi::CloudPlatform::Client) allow_any_instance_of(GoogleApi::CloudPlatform::Client)
.to receive(:projects_zones_clusters_create) do .to receive(:projects_zones_clusters_create) do
OpenStruct.new( OpenStruct.new(
...@@ -82,6 +88,7 @@ feature 'EE Clusters' do ...@@ -82,6 +88,7 @@ feature 'EE Clusters' do
status: 'RUNNING' status: 'RUNNING'
) )
end end
allow(WaitForClusterCreationWorker).to receive(:perform_in).and_return(nil) allow(WaitForClusterCreationWorker).to receive(:perform_in).and_return(nil)
create(:cluster, :provided_by_gcp, name: 'default-cluster', environment_scope: '*', projects: [project]) create(:cluster, :provided_by_gcp, name: 'default-cluster', environment_scope: '*', projects: [project])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment