Sha256: 06a7338cae5b6683a53d36c47860d0d54cf334b35a470e72740d9461c0516614

Contents?: true

Size: 685 Bytes

Versions: 3

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class AvailablePhoneNumberTest < Test::Unit::TestCase
    should "be listable" do
      available_phone_numbers = Telnyx::AvailablePhoneNumber.list
      assert_requested :get, "#{Telnyx.api_base}/v2/available_phone_numbers"
      assert available_phone_numbers.data.is_a?(Array)
      assert available_phone_numbers.first.is_a?(Telnyx::AvailablePhoneNumber)
    end

    should "accept params for list" do
      Telnyx::AvailablePhoneNumber.list phone_number: { starts_with: "2&&", ends_with: "ABC" }
      assert_requested(:get, /#{"#{Telnyx.api_base}/v2/available_phone_numbers"}/)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
telnyx-2.9.0 test/telnyx/available_phone_number_test.rb
telnyx-2.8.0 test/telnyx/available_phone_number_test.rb
telnyx-2.7.0 test/telnyx/available_phone_number_test.rb