summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/api/smtp_cert_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/integration/api/smtp_cert_test.rb b/test/integration/api/smtp_cert_test.rb
index b1bfd43..2f50ef3 100644
--- a/test/integration/api/smtp_cert_test.rb
+++ b/test/integration/api/smtp_cert_test.rb
@@ -33,7 +33,8 @@ class SmtpCertTest < ApiIntegrationTest
assert_text_response
cert = OpenSSL::X509::Certificate.new(get_response.body)
fingerprint = OpenSSL::Digest::SHA1.hexdigest(cert.to_der).scan(/../).join(':')
- expiry = APP_CONFIG[:client_cert_lifespan].months.from_now.utc.midnight
+ number, unit = APP_CONFIG[:client_cert_lifespan].split(' ')
+ expiry = Time.now.utc.at_midnight.advance(unit.to_sym => number.to_i)
expiry_string = expiry.to_date.to_s
fingerprints = {fingerprint => expiry_string}
assert_equal fingerprints, @user.reload.identity.cert_fingerprints