Sha256: 93ae9cfadffd0d0ac439d1f43a9cb6ff07a7d5a35d94076038852c3c0119b011

Contents?: true

Size: 1.52 KB

Versions: 12

Compression:

Stored size: 1.52 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::TwilioError)

    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[
      {
          "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"
          },
          "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

12 entries across 12 versions & 1 rubygems

Version Path
twilio-ruby-5.1.2 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.1.1 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.1.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.alpha1 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc26 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc25 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc24 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc23 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc22 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc21 spec/integration/lookups/v1/phone_number_spec.rb
twilio-ruby-5.0.0.rc20 spec/integration/lookups/v1/phone_number_spec.rb