Sha256: 53b62c6ddec7f9cf753c80fff764754dad8127f1d55abf303e4862a70aa60a02

Contents?: true

Size: 753 Bytes

Versions: 13

Compression:

Stored size: 753 Bytes

Contents

# frozen_string_literal: true

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

13 entries across 13 versions & 1 rubygems

Version Path
telnyx-2.6.0 test/telnyx/number_reservation_test.rb
telnyx-2.5.0 test/telnyx/number_reservation_test.rb
telnyx-2.4.0 test/telnyx/number_reservation_test.rb
telnyx-2.3.0 test/telnyx/number_reservation_test.rb
telnyx-2.2.0 test/telnyx/number_reservation_test.rb
telnyx-0.1.0 test/telnyx/number_reservation_test.rb
telnyx-0.0.8 test/telnyx/number_reservation_test.rb
telnyx-0.0.7 test/telnyx/number_reservation_test.rb
telnyx-0.0.6 test/telnyx/number_reservation_test.rb
telnyx-0.0.5 test/telnyx/number_reservation_test.rb
telnyx-0.0.4 test/telnyx/number_reservation_test.rb
telnyx-0.0.3 test/telnyx/number_reservation_test.rb
telnyx-0.0.2 test/telnyx/number_reservation_test.rb