Sha256: 6bbad3e9a3bae161dd92e6f7b437a038596dea0fc6bfa98648a9da515cc56289

Contents?: true

Size: 1.43 KB

Versions: 5

Compression:

Stored size: 1.43 KB

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class ManagedAccountTest < Test::Unit::TestCase
    setup do
      @id = "d5cced2b-b3c2-7c43-4d8e-0d834c87f7e8"
    end
    should "list managed_accounts" do
      managed_account = ManagedAccount.list
      assert_requested :get, "#{Telnyx.api_base}/v2/managed_accounts"
      assert_kind_of ListObject, managed_account
      assert_kind_of TelnyxObject, managed_account.first
    end

    should "create managed_account" do
      ManagedAccount.create(
        business_name: "Telnyx"
      )
      assert_requested :post, "#{Telnyx.api_base}/v2/managed_accounts"
    end

    should "retrieve managed_account" do
      managed_account = ManagedAccount.retrieve(@id)
      assert_requested :get, "#{Telnyx.api_base}/v2/managed_accounts/#{@id}"
      assert_kind_of TelnyxObject, managed_account
    end

    should "list of allocatable_global_outbound_channels" do
      ManagedAccount.allocatable_global_outbound_channels
      assert_requested :get, "#{Telnyx.api_base}/v2/managed_accounts/allocatable_global_outbound_channels"
    end

    should "update_global_channel_limit" do
      managed_account = ManagedAccount.retrieve(@id)
      id = managed_account.id.gsub(/\s+/, "+").freeze
      managed_account.update_global_channel_limit(api_user: "test")
      assert_requested :patch, "#{Telnyx.api_base}/v2/managed_accounts/#{id}/update_global_channel_limit"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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