Skip to content

Commit

Permalink
Finally added pending spec for testing userNotice extension
Browse files Browse the repository at this point in the history
  • Loading branch information
cchandler committed Sep 16, 2012
1 parent 2a46ccc commit 5e3df97
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions spec/units/certificate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,27 @@
end

it "should contain a nested userNotice if specified" do
pending
# @certificate.sign!({
# "extensions" => {
# "certificatePolicies" => {
# "policy_identifier" => "1.3.5.7",
# "cps_uris" => ["http://my.host.name/", "http://my.your.name/"],
# "user_notice" => {
# "explicit_text" => "Testing!", "organization" => "RSpec Test organization name", "notice_numbers" => "1,2,3,4"
# }
# }
# }
# })
# cert = OpenSSL::X509::Certificate.new(@certificate.to_pem)
# cert.extensions.map(&:oid).include?("certificatePolicies").should be_true
#pending
@certificate.sign!({
"extensions" => {
"certificatePolicies" => {
"policy_identifier" => "1.3.5.7",
"cps_uris" => ["http://my.host.name/", "http://my.your.name/"],
"user_notice" => {
"explicit_text" => "Testing explicit text!", "organization" => "RSpec Test organization name", "notice_numbers" => "1,2,3,4"
}
}
}
})
cert = OpenSSL::X509::Certificate.new(@certificate.to_pem)
cert.extensions.map(&:oid).include?("certificatePolicies").should be_true
## Checking OIDs after they've run through OpenSSL is a pain...
## The nicely structured data will be flattened to a single String
cert.extensions.each do |ext|
if ext.oid == "certificatePolicies"
ext.to_a[1].should include("Testing explicit text!")
end
end
end

it "should NOT include a certificatePolicy if not specified" do
Expand Down

0 comments on commit 5e3df97

Please sign in to comment.