Sha256: 2146f8701ebfb40932631ccd8d0e0a90650bf4bdb2a12466c9a6cd1b9de4f9bd

Contents?: true

Size: 857 Bytes

Versions: 7

Compression:

Stored size: 857 Bytes

Contents

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

class LocalPhoneNumberTest < Test::Unit::TestCase #:nodoc: all
  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

7 entries across 7 versions & 2 rubygems

Version Path
webficient-twilio-1.2.0 test/twilio/local_phone_number_test.rb
webficient-twilio-1.3.0 test/twilio/local_phone_number_test.rb
webficient-twilio-1.4.0 test/twilio/local_phone_number_test.rb
webficient-twilio-2.0.0 test/twilio/local_phone_number_test.rb
webficient-twilio-2.1.0 test/twilio/local_phone_number_test.rb
webficient-twilio-2.2.0 test/twilio/local_phone_number_test.rb
twilio-1.4.0 test/twilio/local_phone_number_test.rb