Sha256: 6cd55e9325d00714c8d7ffac26fe4c643e3f02a18aa97dfdaf0adc7890ad2507

Contents?: true

Size: 1.08 KB

Versions: 9

Compression:

Stored size: 1.08 KB

Contents

require "spec_helper"

RSpec.describe "Container Management" do
  describe "fetching a container template", api_call: true do
    it "fetches the first container template details" do
      templates = Digicert::ContainerTemplate.all(container_id)
      template = Digicert::ContainerTemplate.fetch(
        template_id: templates.first.id, container_id: container_id,
      )

      expect(template.name).to eq("Business Unit")
      expect(template.access_roles.first.name).to eq("Administrator")
    end
  end

  describe "fetching a container details", api_call: true do
    it "retrieves the details for a container" do
      container = Digicert::Container.fetch(container_id)

      expect(container.is_active).to eq(true)
      expect(container.name).to eq("Ribose Inc.")
    end
  end

  def container_id
    @container_id ||= containers.first.id
  end

  def containers
    # We are making this API call intentionally, this
    # ensures the listing containers API is working as
    # it should have as long as there are no errors.
    #
    @containers ||= Digicert::Container.all
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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