summaryrefslogtreecommitdiff
path: root/certs/test
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-26 11:23:43 +0100
committerAzul <azul@leap.se>2013-01-26 11:23:43 +0100
commit8d9c2e90b77d417f9715c95de91c629e80ca6603 (patch)
treeb449fea406e45de9e4cfd9462c4fc5cb01c74cee /certs/test
parent0f8efed9afa480174c77c89d4d9d4a40f99bddab (diff)
no need to store the cert anymore - just new initialize and send it
Diffstat (limited to 'certs/test')
-rw-r--r--certs/test/functional/certs_controller_test.rb2
-rw-r--r--certs/test/unit/client_certificate_test.rb18
2 files changed, 5 insertions, 15 deletions
diff --git a/certs/test/functional/certs_controller_test.rb b/certs/test/functional/certs_controller_test.rb
index 887d5f0..75256ca 100644
--- a/certs/test/functional/certs_controller_test.rb
+++ b/certs/test/functional/certs_controller_test.rb
@@ -13,7 +13,7 @@ class CertsControllerTest < ActionController::TestCase
test "should send cert" do
login
cert = stub :cert => "adsf", :key => "key"
- ClientCertificate.expects(:create).returns(cert)
+ ClientCertificate.expects(:new).returns(cert)
get :show
assert_response :success
assert_equal cert.key + cert.cert, @response.body
diff --git a/certs/test/unit/client_certificate_test.rb b/certs/test/unit/client_certificate_test.rb
index 7dbb8a9..492a44a 100644
--- a/certs/test/unit/client_certificate_test.rb
+++ b/certs/test/unit/client_certificate_test.rb
@@ -3,22 +3,12 @@ require 'test_helper'
class ClientCertificateTest < ActiveSupport::TestCase
setup do
- @sample = ClientCertificate.new ClientCertificate.valid_attributes_hash
+ @sample = ClientCertificate.new
end
- test "stub cert for testing is valid" do
- assert @sample.valid?
+ test "new cert has all we need" do
+ assert @sample.key
+ assert @sample.cert
end
- test "validates key" do
- @sample.key = nil
- assert @sample.valid?
- assert @sample.key, "Cert should generate key"
- end
-
- test "validates cert" do
- @sample.cert = nil
- assert @sample.valid?
- assert @sample.cert, "Cert should generate cert"
- end
end