Sha256: 626cf30e908f638b3131444dc90a84b1db5e215ce5389005c31437251265cb96

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'

class IncomingPhoneNumberTest < Test::Unit::TestCase #:nodoc: all
  context "An incoming phone number" do
    setup do
      Twilio.connect('mysid', 'mytoken')
    end

    should "be retrievable individually" do
      assert_equal  stub_response(:get, :incoming_phone_number, :resource => 'IncomingPhoneNumbers/PNe536dfda7c6184afab78d980cb8cdf43'),
        Twilio::IncomingPhoneNumber.get('PNe536dfda7c6184afab78d980cb8cdf43')
    end
    
    should "be retrievable as a list" do
      assert_equal stub_response(:get, :incoming_phone_numbers, :resource => 'IncomingPhoneNumbers'),
        Twilio::IncomingPhoneNumber.list
    end
    
    context "using deprecated API" do
      setup do
        @connection = Twilio::Connection.new('mysid', 'mytoken')
        @incoming = Twilio::IncomingPhoneNumber.new(@connection)
      end

      should "be retrievable individually" do
        assert_equal stub_response(:get, :incoming_phone_number, :resource => 'IncomingPhoneNumbers/PNe536dfda7c6184afab78d980cb8cdf43'), 
          @incoming.get('PNe536dfda7c6184afab78d980cb8cdf43')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
twilio-2.8.0 test/twilio/incoming_phone_number_test.rb
twilio-2.7.0 test/twilio/incoming_phone_number_test.rb
twilio-2.6.0 test/twilio/incoming_phone_number_test.rb
twilio-2.5.0 test/twilio/incoming_phone_number_test.rb
twilio-2.4.1 test/twilio/incoming_phone_number_test.rb