summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/v1/smtp_certs_controller_test.rb6
-rw-r--r--test/unit/client_certificate_test.rb4
2 files changed, 5 insertions, 5 deletions
diff --git a/test/functional/v1/smtp_certs_controller_test.rb b/test/functional/v1/smtp_certs_controller_test.rb
index 3427e2d..ba70410 100644
--- a/test/functional/v1/smtp_certs_controller_test.rb
+++ b/test/functional/v1/smtp_certs_controller_test.rb
@@ -26,11 +26,11 @@ class V1::SmtpCertsControllerTest < ActionController::TestCase
protected
- def expect_cert(prefix)
- cert = stub to_s: "#{prefix.downcase} cert",
+ def expect_cert(email)
+ cert = stub to_s: "#{email.downcase} cert",
expiry: 1.month.from_now.utc.at_midnight
ClientCertificate.expects(:new).
- with(:prefix => prefix).
+ with(:common_name => email).
returns(cert)
return cert
end
diff --git a/test/unit/client_certificate_test.rb b/test/unit/client_certificate_test.rb
index 036e724..7f7e14b 100644
--- a/test/unit/client_certificate_test.rb
+++ b/test/unit/client_certificate_test.rb
@@ -3,7 +3,7 @@ require 'test_helper'
class ClientCertificateTest < ActiveSupport::TestCase
test "new cert has all we need" do
- sample = ClientCertificate.new
+ sample = ClientCertificate.new(:common_name => 'test')
assert sample.key
assert sample.cert
assert sample.to_s
@@ -16,7 +16,7 @@ class ClientCertificateTest < ActiveSupport::TestCase
end
test "cert issuer matches ca subject" do
- sample = ClientCertificate.new
+ sample = ClientCertificate.new(:prefix => 'test')
cert = OpenSSL::X509::Certificate.new(sample.cert.to_pem)
assert_equal ClientCertificate.root_ca.openssl_body.subject, cert.issuer
end