Sha256: 7a5b4f815e6c4a8985f497b5bec669a05173d6941be09174ff7bdba2d3c14497

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

require "spec_helper"

RSpec.describe Digicert::CLI::Order do
  describe "#list" do
    context "without order_id attributes" do
      it "sends all message to digicert order interface" do
        allow(Digicert::Order).to receive(:all).and_return([])

        order = Digicert::CLI::Order.new
        order.list

        expect(Digicert::Order).to have_received(:all)
      end
    end
  end

  describe "#find" do
    context "without any option" do
      it "returns the first filtered order from digicert" do
        common_name = "digicert.com"
        stub_digicert_order_list_api

        order = Digicert::CLI::Order.new(common_name: common_name).find

        expect(order.id).not_to be_nil
        expect(order.certificate.common_name).to eq(common_name)
      end
    end

    context "with quiet option" do
      it "only returns the id from the order" do
        common_name = "digicert.com"
        stub_digicert_order_list_api

        order_id = Digicert::CLI::Order.new(
          common_name: common_name, quiet: true,
        ).find

        expect(order_id).to be_a(Integer)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
digicert-cli-1.0.0 spec/digicert/cli/order_spec.rb
digicert-cli-0.5.2 spec/digicert/cli/order_spec.rb
digicert-cli-0.5.1 spec/digicert/cli/order_spec.rb
digicert-cli-0.5.0 spec/digicert/cli/order_spec.rb
digicert-cli-0.4.2 spec/digicert/cli/order_spec.rb
digicert-cli-0.4.1 spec/digicert/cli/order_spec.rb
digicert-cli-0.4.0 spec/digicert/cli/order_spec.rb
digicert-cli-0.3.0 spec/digicert/cli/order_spec.rb
digicert-cli-0.2.0 spec/digicert/cli/order_spec.rb