Sha256: 89780d7eef24eb8c49161e2d60907eb0a9ef3601568da3fe8812e9fe98d4f8d5

Contents?: true

Size: 788 Bytes

Versions: 3

Compression:

Stored size: 788 Bytes

Contents

# frozen_string_literal: true

require_relative "../test_helper"

module Telnyx
  class NumberReservationTest < Test::Unit::TestCase
    should "be listable" do
      number_reservations = Telnyx::NumberReservation.list
      assert_requested :get, "#{Telnyx.api_base}/v2/number_reservations"
      assert_kind_of Telnyx::ListObject, number_reservations
      assert_kind_of Telnyx::NumberReservation, number_reservations.first
    end

    should "call extend" do
      number_reservation = Telnyx::NumberReservation.list.first
      stub = stub_request(:post, "#{Telnyx.api_base}/v2/number_reservations/#{number_reservation.id}/actions/extend")
             .to_return(body: JSON.generate(id: "123"))
      number_reservation.extend_number
      assert_requested stub
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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