Sha256: 47387744ac873e7544026302e344076901a7418acba8e0d0abed3ee9885aee92

Contents?: true

Size: 961 Bytes

Versions: 3

Compression:

Stored size: 961 Bytes

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class FQDNTest < Test::Unit::TestCase
    should "list fqdns" do
      fqdn = FQDN.list
      assert_requested :get, "#{Telnyx.api_base}/v2/fqdns"
      assert_kind_of ListObject, fqdn
      assert_kind_of FQDN, fqdn.first
    end

    should "create fqdn" do
      FQDN.create fqdn: "example.com"
      assert_requested :post, "#{Telnyx.api_base}/v2/fqdns"
    end

    should "retrieve fqdn" do
      fqdn = FQDN.retrieve("id")
      assert_requested :get, "#{Telnyx.api_base}/v2/fqdns/id"
      assert_kind_of FQDN, fqdn
    end

    should "delete fqdn" do
      fqdn = FQDN.retrieve("id")

      fqdn.delete
      assert_requested :delete, "#{Telnyx.api_base}/v2/fqdns/id"
    end

    should "update fqdn" do
      fqdn = FQDN.retrieve("id")

      fqdn.fqdn = "example.com"
      fqdn.save
      assert_requested :patch, "#{Telnyx.api_base}/v2/fqdns/id"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
telnyx-2.3.0 test/telnyx/fqdn_test.rb
telnyx-2.2.0 test/telnyx/fqdn_test.rb
telnyx-0.1.0 test/telnyx/fqdn_test.rb