Sha256: 79f4085a12fa72fa14a0a6e987c61ccb1f7a583f75cb7d2dfc38f8125ac68b73
Contents?: true
Size: 1.35 KB
Versions: 2
Compression:
Stored size: 1.35 KB
Contents
require "spec_helper" RSpec.describe Digicert::OrderDuplicator do describe ".create" do it "creates a duplicate of an existing order" do stub_digicert_order_fetch_api(order_id) stub_digicert_order_duplicate_api(order_id, certificate_attributes) order = Digicert::OrderDuplicator.create(order_id: order_id) expect(order.id).not_to be_nil expect(order.requests.first.id).not_to be_nil end context "ev plus certificate" do it "cleanup data and duplicates an order" do stub_digicert_order_fetch_api(order_id, "ssl_ev_order") stub_digicert_ev_plus_duplicate_api order = Digicert::OrderDuplicator.create(order_id: order_id) expect(order.id).not_to be_nil end end end def order_id 123_456_789 end def certificate_attributes { common_name: order.certificate.common_name, dns_names: order.certificate.dns_names, csr: order.certificate.csr, signature_hash: order.certificate.signature_hash, server_platform: { id: order.certificate.server_platform.id }, } end def stub_digicert_ev_plus_duplicate_api attributes = certificate_attributes attributes[:dns_names] = [attributes[:dns_names].last] stub_digicert_order_duplicate_api(order_id, attributes) end def order @order ||= Digicert::Order.fetch(order_id) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
digicert-1.0.0 | spec/digicert/order_duplicator_spec.rb |
digicert-0.5.0 | spec/digicert/order_duplicator_spec.rb |