Sha256: 039f577472a139d31e8c69814d394c8fcdb32f9aff9e3b0589df2fb59bdbd3f4

Contents?: true

Size: 844 Bytes

Versions: 1

Compression:

Stored size: 844 Bytes

Contents

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

class LocalPhoneNumberTest < Test::Unit::TestCase
  context "A local phone number" do
    setup do
      @connection = Twilio::Connection.new('mysid', 'mytoken')
      @local = Twilio::LocalPhoneNumber.new(@connection)
    end

    should "be retrievable as a list" do
      fake_response = fixture(:incoming_phone_numbers)
      FakeWeb.register_uri(:get, twilio_url('IncomingPhoneNumbers/Local'), :string => fake_response)
      assert_equal @local.list, fake_response
    end
    
    should "be created" do
      fake_response = fixture(:incoming_phone_number)
      FakeWeb.register_uri(:post, twilio_url('IncomingPhoneNumbers/Local'), :string => fake_response)
      response = @local.create('http://test.local/call_handler')
      assert_equal response, fake_response
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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