Sha256: 2192fe41b4f5b8bbb4327c3ab323da2a2e3a58d5cb25f23286627b5f3b988a78

Contents?: true

Size: 877 Bytes

Versions: 1

Compression:

Stored size: 877 Bytes

Contents

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

class IncomingPhoneNumberTest < Test::Unit::TestCase
  context "An incoming phone number" do
    setup do
      @connection = Twilio::Connection.new('mysid', 'mytoken')
      @incoming = Twilio::IncomingPhoneNumber.new(@connection)
    end

    should "be retrievable as a list" do
      fake_response = fixture(:incoming_phone_numbers)
      FakeWeb.register_uri(:get, twilio_url('IncomingPhoneNumbers'), :string => fake_response)
      assert_equal @incoming.list, fake_response
    end
    
    should "be retrievable individually" do
      fake_response = fixture(:incoming_phone_number)
      FakeWeb.register_uri(:get, twilio_url('IncomingPhoneNumbers/PNe536dfda7c6184afab78d980cb8cdf43'), :string => fake_response)
      assert_equal @incoming.get('PNe536dfda7c6184afab78d980cb8cdf43'), fake_response
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webficient-twilio-1.0.0 test/twilio/incoming_phone_number_test.rb