Sha256: 413469d4c5152c379e27303caa849953f06c625a07d33cfd230ecc0655653e68

Contents?: true

Size: 1.34 KB

Versions: 5

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class FQDNConnectionTest < Test::Unit::TestCase
    should "list fqdn connections" do
      fqdn_connections = FQDNConnection.list
      assert_requested :get, "#{Telnyx.api_base}/v2/fqdn_connections"
      assert_kind_of ListObject, fqdn_connections
      assert_kind_of TelnyxObject, fqdn_connections.first
    end

    should "create fqdn connection" do
      FQDNConnection.create(connection_name: "test")
      assert_requested :post, "#{Telnyx.api_base}/v2/fqdn_connections"
    end

    should "retrieve fqdn connection" do
      fqdn_connection = FQDNConnection.retrieve("id")
      assert_requested :get, "#{Telnyx.api_base}/v2/fqdn_connections/id"
      assert_kind_of FQDNConnection, fqdn_connection
    end

    should "delete fqdn connection" do
      fqdn_connection = FQDNConnection.retrieve("id")
      id = fqdn_connection.id.gsub(/\s+/, "+").freeze
      fqdn_connection.delete
      assert_requested :delete, "#{Telnyx.api_base}/v2/fqdn_connections/#{id}"
    end

    should "update fqdn connection" do
      fqdn_connection = FQDNConnection.retrieve("id")
      id = fqdn_connection.id.gsub(/\s+/, "+").freeze
      fqdn_connection.active = false
      fqdn_connection.save
      assert_requested :patch, "#{Telnyx.api_base}/v2/fqdn_connections/#{id}"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
telnyx-3.0.5 test/telnyx/fqdn_connection_test.rb
telnyx-3.0.4 test/telnyx/fqdn_connection_test.rb
telnyx-3.0.3 test/telnyx/fqdn_connection_test.rb
telnyx-3.0.2 test/telnyx/fqdn_connection_test.rb
telnyx-3.0.0 test/telnyx/fqdn_connection_test.rb