diff options
Diffstat (limited to 'spec/factories/clusters/applications/helm.rb')
-rw-r--r-- | spec/factories/clusters/applications/helm.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/factories/clusters/applications/helm.rb b/spec/factories/clusters/applications/helm.rb index d78f01828d7..89f7bc15217 100644 --- a/spec/factories/clusters/applications/helm.rb +++ b/spec/factories/clusters/applications/helm.rb @@ -1,7 +1,23 @@ +# frozen_string_literal: true + FactoryBot.define do factory :clusters_applications_helm, class: Clusters::Applications::Helm do cluster factory: %i(cluster provided_by_gcp) + before(:create) do + allow(Gitlab::Kubernetes::Helm::Certificate).to receive(:generate_root) + .and_return( + double( + key_string: File.read(Rails.root.join('spec/fixtures/clusters/sample_key.key')), + cert_string: File.read(Rails.root.join('spec/fixtures/clusters/sample_cert.pem')) + ) + ) + end + + after(:create) do + allow(Gitlab::Kubernetes::Helm::Certificate).to receive(:generate_root).and_call_original + end + trait :not_installable do status(-2) end @@ -58,7 +74,7 @@ FactoryBot.define do cluster factory: %i(cluster with_installed_helm provided_by_gcp) end - factory :clusters_applications_cert_managers, class: Clusters::Applications::CertManager do + factory :clusters_applications_cert_manager, class: Clusters::Applications::CertManager do email 'admin@example.com' cluster factory: %i(cluster with_installed_helm provided_by_gcp) end |