Sha256: 36bc28ec2fbcd3c251c1e13ff3354a77548cc919d54eb623f5c87a64e56a5b87

Contents?: true

Size: 1.38 KB

Versions: 10

Compression:

Stored size: 1.38 KB

Contents

##
# This code was generated by
# \ / _    _  _|   _  _
#  | (_)\/(_)(_|\/| |(/_  v1.0.0
#       /       /       

require 'spec_helper.rb'

describe 'PhoneNumber' do
  it "can fetch" do
    @holodeck.mock(Twilio::TwilioResponse.new(500, ''))
    
    expect {
      @client.lookups.v1.phone_numbers("+987654321").fetch()
    }.to raise_exception(Twilio::REST::TwilioException)
    
    values = {}
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://lookups.twilio.com/v1/PhoneNumbers/+987654321',
    ))).to eq(true)
  end

  it "receives fetch responses" do
    @holodeck.mock(Twilio::TwilioResponse.new(
        200,
      %q[
      {
          "carrier": {
              "error_code": null,
              "mobile_country_code": "310",
              "mobile_network_code": "456",
              "name": "verizon",
              "type": "mobile"
          },
          "country_code": "US",
          "national_format": "(510) 867-5309",
          "phone_number": "+15108675309",
          "add_ons": {
              "status": "successful",
              "message": null,
              "code": null,
              "results": {}
          },
          "url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
      }
      ]
    ))
    
    actual = @client.lookups.v1.phone_numbers("+987654321").fetch()
    
    expect(actual).to_not eq(nil)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
twilio-ruby-5.0.0.rc16 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc15 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc14 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc13 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc12 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc11 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc10 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc9 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc8 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc7 spec/integration/lookups/v1/phone_number_spec.rb