summaryrefslogtreecommitdiff
path: root/spec/support/services/clusters
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/services/clusters')
-rw-r--r--spec/support/services/clusters/create_service_shared.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/support/services/clusters/create_service_shared.rb b/spec/support/services/clusters/create_service_shared.rb
index 43a2fd05498..b45ad3f6b8c 100644
--- a/spec/support/services/clusters/create_service_shared.rb
+++ b/spec/support/services/clusters/create_service_shared.rb
@@ -29,9 +29,12 @@ shared_context 'invalid cluster create params' do
end
shared_examples 'create cluster service success' do
- it 'creates a cluster object and performs a worker' do
+ before do
+ stub_feature_flags(rbac_clusters: false)
expect(ClusterProvisionWorker).to receive(:perform_async)
+ end
+ it 'creates a cluster object and performs a worker' do
expect { subject }
.to change { Clusters::Cluster.count }.by(1)
.and change { Clusters::Providers::Gcp.count }.by(1)
@@ -44,8 +47,19 @@ shared_examples 'create cluster service success' do
expect(subject.provider.num_nodes).to eq(1)
expect(subject.provider.machine_type).to eq('machine_type-a')
expect(subject.provider.access_token).to eq(access_token)
+ expect(subject.provider).to be_legacy_abac
expect(subject.platform).to be_nil
end
+
+ context 'rbac_clusters feature is enabled' do
+ before do
+ stub_feature_flags(rbac_clusters: true)
+ end
+
+ it 'has legacy_abac false' do
+ expect(subject.provider).not_to be_legacy_abac
+ end
+ end
end
shared_examples 'create cluster service error' do