Sha256: f50f6ef9c1270eb52013d3c9f1b49c89572b545e010cf26015f55713f4bac198

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 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 FQDNConnection, 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")

      fqdn_connection.delete
      assert_requested :delete, "#{Telnyx.api_base}/v2/fqdn_connections/id"
    end

    should "update fqdn connection" do
      fqdn_connection = FQDNConnection.retrieve("id")

      fqdn_connection.active = false
      fqdn_connection.save
      assert_requested :patch, "#{Telnyx.api_base}/v2/fqdn_connections/id"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
telnyx-2.9.0 test/telnyx/fqdn_connection_test.rb
telnyx-2.8.0 test/telnyx/fqdn_connection_test.rb
telnyx-2.7.0 test/telnyx/fqdn_connection_test.rb
telnyx-2.6.0 test/telnyx/fqdn_connection_test.rb
telnyx-2.5.0 test/telnyx/fqdn_connection_test.rb
telnyx-2.4.0 test/telnyx/fqdn_connection_test.rb