diff options
author | Luke Kanies <luke@madstop.com> | 2008-08-07 17:39:13 -0700 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-08-07 17:39:13 -0700 |
commit | 113d74aaa630f499c8b7989aac6680e22e8e38c8 (patch) | |
tree | 250783a4ef765ca37b70f98d6df6782f986d99ba /spec/unit/ssl/certificate_request.rb | |
parent | 2cad30a18c5e0e4fb93603ab422c290a62d45131 (diff) | |
download | puppet-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-x | spec/unit/ssl/certificate_request.rb | 16 |
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 |