Fix cert_manager_spec to not modify String
Also break up long string to be readable
This commit is contained in:
parent
a2cfc150ce
commit
3a1a12b383
|
@ -11,7 +11,27 @@ describe Clusters::Applications::CertManager do
|
|||
include_examples 'cluster application initial status specs'
|
||||
|
||||
describe '#install_command' do
|
||||
let(:cluster_issuer_file) { { "cluster_issuer.yaml": "---\napiVersion: certmanager.k8s.io/v1alpha1\nkind: ClusterIssuer\nmetadata:\n name: letsencrypt-prod\nspec:\n acme:\n server: https://acme-v02.api.letsencrypt.org/directory\n email: admin@example.com\n privateKeySecretRef:\n name: letsencrypt-prod\n http01: {}\n" } }
|
||||
let(:cert_email) { 'admin@example.com' }
|
||||
|
||||
let(:cluster_issuer_file) do
|
||||
file_contents = <<~EOF
|
||||
---
|
||||
apiVersion: certmanager.k8s.io/v1alpha1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt-prod
|
||||
spec:
|
||||
acme:
|
||||
server: https://acme-v02.api.letsencrypt.org/directory
|
||||
email: #{cert_email}
|
||||
privateKeySecretRef:
|
||||
name: letsencrypt-prod
|
||||
http01: {}
|
||||
EOF
|
||||
|
||||
{ "cluster_issuer.yaml": file_contents }
|
||||
end
|
||||
|
||||
subject { cert_manager.install_command }
|
||||
|
||||
it { is_expected.to be_an_instance_of(Gitlab::Kubernetes::Helm::InstallCommand) }
|
||||
|
@ -26,9 +46,10 @@ describe Clusters::Applications::CertManager do
|
|||
end
|
||||
|
||||
context 'for a specific user' do
|
||||
let(:cert_email) { 'abc@xyz.com' }
|
||||
|
||||
before do
|
||||
cert_manager.email = 'abc@xyz.com'
|
||||
cluster_issuer_file[:'cluster_issuer.yaml'].gsub! 'admin@example.com', 'abc@xyz.com'
|
||||
cert_manager.email = cert_email
|
||||
end
|
||||
|
||||
it 'should use his/her email to register issuer with certificate provider' do
|
||||
|
|
Loading…
Reference in New Issue