Sha256: c25d64e3f648ba0b789cbfea2d65821e0e8004a22308a2c9d7d0c86b507a5843

Contents?: true

Size: 1.88 KB

Versions: 28

Compression:

Stored size: 1.88 KB

Contents

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

require 'spec_helper.rb'

describe 'PhoneNumber' do
  it "can fetch" do
    @holodeck.mock(Twilio::Response.new(500, ''))

    expect {
      @client.lookups.v1.phone_numbers('+15017122661').fetch()
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {}
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://lookups.twilio.com/v1/PhoneNumbers/+15017122661',
    ))).to eq(true)
  end

  it "receives fetch responses" do
    @holodeck.mock(Twilio::Response.new(
        200,
      %q[
      {
          "caller_name": {
              "caller_name": "Delicious Cheese Cake",
              "caller_type": "CONSUMER",
              "error_code": null
          },
          "carrier": {
              "error_code": null,
              "mobile_country_code": "310",
              "mobile_network_code": "456",
              "name": "verizon",
              "type": "mobile"
          },
          "fraud": {
              "error_code": null,
              "mobile_country_code": "310",
              "mobile_network_code": "456",
              "advanced_line_type": "voip",
              "caller_name": "Delicious Cheese Cake",
              "is_ported": false,
              "last_ported_date": "2018-05-01 04:05:11"
          },
          "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('+15017122661').fetch()

    expect(actual).to_not eq(nil)
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
twilio-ruby-5.21.2 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.21.1 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.21.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.20.1 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.20.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.19.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.18.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.17.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.16.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.15.2 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.15.1 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.15.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.14.1 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.14.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.13.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.12.4 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.12.3 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.12.2 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.12.1 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.12.0 spec/integration/lookups/v1/phone_number_spec.rb