Sha256: cbda82a5688045c066e5dc4703e84c85df2f6821574550348c4b27acce5d18e0

Contents?: true

Size: 1.14 KB

Versions: 8

Compression:

Stored size: 1.14 KB

Contents

require "spec_helper"

RSpec.describe Digicert::Container do
  describe ".all" do
    it "retrieves the list of containers" do
      stub_digicert_container_list_api
      containers = Digicert::Container.all

      expect(containers.first.id).not_to be_nil
      expect(containers.first.name).to eq("Ribose Inc.")
    end
  end

  describe ".create" do
    it "creates a new sub container" do
      stub_digicert_container_create_api(container_attributes)
      container = Digicert::Container.create(container_attributes)

      expect(container.id).not_to be_nil
    end
  end

  describe ".fetch" do
    it "retrieves the details for a container" do
      container_id = 123_456_789

      stub_digicert_container_fetch_api(container_id)
      container = Digicert::Container.fetch(container_id)

      expect(container.name).not_to be_nil
      expect(container.parent_id).not_to be_nil
      expect(container.allowed_domain_names.first).to eq("abc.xyz")
    end
  end

  def container_attributes
    {
      container_id: 123_456_789,
      name: "History Department",
      template_id: 5,
      description: "History, Civ, Ancient Languages",
    }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
digicert-0.5.0 spec/digicert/container_spec.rb
digicert-0.4.1 spec/digicert/container_spec.rb
digicert-0.4.0 spec/digicert/container_spec.rb
digicert-0.3.1 spec/digicert/container_spec.rb
digicert-0.3.0 spec/digicert/container_spec.rb
digicert-0.2.0 spec/digicert/container_spec.rb
digicert-0.1.2 spec/digicert/container_spec.rb
digicert-0.1.1 spec/digicert/container_spec.rb