Sha256: 17e750d9f78ecf27ab1249dd684f50f71fe70bd17995e7851125680fea7b7d24

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

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

require 'spec_helper.rb'

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

    expect {
      @client.preview.trusted_comms.current_calls().fetch()
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {}
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://preview.twilio.com/TrustedComms/CurrentCall',
    ))).to eq(true)
  end

  it "receives read_found responses" do
    @holodeck.mock(Twilio::Response.new(
        200,
      %q[
      {
          "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "from": "+15000000000",
          "to": "+573000000000",
          "status": "ringing",
          "reason": "Hello Jhon, your bank appointment has been confirmed.",
          "created_at": "2019-05-01T20:00:00Z",
          "caller": "Owl Bank",
          "logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
          "bg_color": "#fff",
          "font_color": "#f22f46",
          "use_case": "conversational",
          "manager": "Twilio",
          "shield_img": "https://www.twilio.com/marketing/bundles/company/img/badges/red/twilio-badge-red.png",
          "url": "https://preview.twilio.com/TrustedComms/CurrentCall"
      }
      ]
    ))

    actual = @client.preview.trusted_comms.current_calls().fetch()

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twilio-ruby-5.24.0 spec/integration/preview/trusted_comms/current_call_spec.rb