diff options
author | Tiger <twatson@gitlab.com> | 2019-07-26 15:40:36 +1000 |
---|---|---|
committer | Tiger <twatson@gitlab.com> | 2019-08-01 13:59:29 +1000 |
commit | 07572a93ac5f111b04a191636adcb1e2a5958457 (patch) | |
tree | 7913dc407974a153e25cf7e67d11bb1575bf2d7f /spec/factories | |
parent | 7f198de92914664363a18a5da079cd289580f8ba (diff) | |
download | gitlab-ce-07572a93ac5f111b04a191636adcb1e2a5958457.tar.gz |
Use stubbed certificate and key in Helm factoryexplicit-helm-factory-certs
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/clusters/applications/helm.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/factories/clusters/applications/helm.rb b/spec/factories/clusters/applications/helm.rb index 24c22ef3928..89f7bc15217 100644 --- a/spec/factories/clusters/applications/helm.rb +++ b/spec/factories/clusters/applications/helm.rb @@ -4,6 +4,20 @@ 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 |