Sha256: 6005ef2e147b59f58b1dda2513e64c99a0912d5d2ce92b17d90596781fe80797

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require "spec_helper"

RSpec.describe "Order reissuing" do
  describe "reissue an order" do
    context "reissue with new csr" do
      it "reissues an order with the provided csr" do
        mock_digicert_order_reissuer_create_message_chain
        command = %w(order reissue 123456 --crt ./spec/fixtures/rsa4096.csr)

        Digicert::CLI.start(command)

        expect(Digicert::CLI::OrderReissuer).to have_received(:new).
          with(order_id: "123456", crt: "./spec/fixtures/rsa4096.csr")
      end
    end

    context "reissue and download certificate" do
      it "reissues an order and download the certificate" do
        mock_digicert_order_reissuer_create_message_chain
        command = %w(order reissue 123456 --output /tmp/downloads)

        Digicert::CLI.start(command)

        expect(Digicert::CLI::OrderReissuer).to have_received(:new).
          with(order_id: "123456", output: "/tmp/downloads")
      end
    end
  end

  def mock_digicert_order_reissuer_create_message_chain
    allow(Digicert::CLI::OrderReissuer).to receive_message_chain(:new, :create)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
digicert-cli-0.2.0 spec/acceptance/reissuing_order_spec.rb