summaryrefslogtreecommitdiffstats
path: root/spec/unit/ssl/certificate_request.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-07 17:39:13 -0700
committerLuke Kanies <luke@madstop.com>2008-08-07 17:39:13 -0700
commit113d74aaa630f499c8b7989aac6680e22e8e38c8 (patch)
tree250783a4ef765ca37b70f98d6df6782f986d99ba /spec/unit/ssl/certificate_request.rb
parent2cad30a18c5e0e4fb93603ab422c290a62d45131 (diff)
downloadpuppet-113d74aaa630f499c8b7989aac6680e22e8e38c8.tar.gz
puppet-113d74aaa630f499c8b7989aac6680e22e8e38c8.tar.xz
puppet-113d74aaa630f499c8b7989aac6680e22e8e38c8.zip
Certificates now work over REST.
All of the format work is done, they all support plaintext successfully, and I've got integration tests that demonstrate that it actually works. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/ssl/certificate_request.rb')
-rwxr-xr-xspec/unit/ssl/certificate_request.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/unit/ssl/certificate_request.rb b/spec/unit/ssl/certificate_request.rb
index 4a7d655ac..aa6bba625 100755
--- a/spec/unit/ssl/certificate_request.rb
+++ b/spec/unit/ssl/certificate_request.rb
@@ -27,7 +27,21 @@ describe Puppet::SSL::CertificateRequest do
end
it "should only support the text format" do
- @class.supported_formats.should == [:str]
+ @class.supported_formats.should == [:s]
+ end
+
+ describe "when converting from a string" do
+ it "should create a CSR instance with its name set to the CSR subject and its content set to the extracted CSR" do
+ csr = stub 'csr', :subject => "/CN=Foo.madstop.com"
+ OpenSSL::X509::Request.expects(:new).with("my csr").returns(csr)
+
+ mycsr = stub 'sslcsr'
+ mycsr.expects(:content=).with(csr)
+
+ @class.expects(:new).with("foo.madstop.com").returns mycsr
+
+ @class.from_s("my csr")
+ end
end
describe "when managing instances" do