diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 18:08:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-30 18:08:07 +0000 |
commit | 2c72daf2f1744f2b8c8c6674c266907e9ef55558 (patch) | |
tree | e489b6e87557d3f6d8a94f2e7d4d47e633d646b5 /spec/support/helpers/lets_encrypt_helpers.rb | |
parent | 4e9acbfba3682c552b3de707c535e6257ef41054 (diff) | |
download | gitlab-ce-2c72daf2f1744f2b8c8c6674c266907e9ef55558.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/helpers/lets_encrypt_helpers.rb')
-rw-r--r-- | spec/support/helpers/lets_encrypt_helpers.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/support/helpers/lets_encrypt_helpers.rb b/spec/support/helpers/lets_encrypt_helpers.rb index 2857416ad95..0f378893895 100644 --- a/spec/support/helpers/lets_encrypt_helpers.rb +++ b/spec/support/helpers/lets_encrypt_helpers.rb @@ -11,7 +11,8 @@ module LetsEncryptHelpers status: 'pending', token: 'tokenvalue', file_content: 'hereisfilecontent', - request_validation: true + request_validation: true, + error: nil }.freeze def stub_lets_encrypt_settings @@ -43,16 +44,17 @@ module LetsEncryptHelpers challenge end - def acme_authorization_double + def acme_authorization_double(challenge = acme_challenge_double) authorization = instance_double('Acme::Client::Resources::Authorization') - allow(authorization).to receive(:http).and_return(acme_challenge_double) + allow(authorization).to receive(:http).and_return(challenge) + allow(authorization).to receive(:challenges).and_return([challenge]) authorization end def acme_order_double(attributes = {}) acme_order = instance_double('Acme::Client::Resources::Order') allow(acme_order).to receive_messages(ACME_ORDER_METHODS.merge(attributes)) - allow(acme_order).to receive(:authorizations).and_return([acme_authorization_double]) + allow(acme_order).to receive(:authorizations).and_return([acme_authorization_double]) unless attributes[:authorizations] allow(acme_order).to receive(:finalize) acme_order end |