Sha256: 77841fe4f0792c7e9e90a4e4c0644fa3af4fbad106c54be4612fc8006c0e19c9

Contents?: true

Size: 1.86 KB

Versions: 21

Compression:

Stored size: 1.86 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(x_xcnam_sensitive_phone_number_from: 'x_xcnam_sensitive_phone_number_from', x_xcnam_sensitive_phone_number_to: 'x_xcnam_sensitive_phone_number_to')
    }.to raise_exception(Twilio::REST::TwilioError)

    headers = {
        'X-Xcnam-Sensitive-Phone-Number-From' => 'x_xcnam_sensitive_phone_number_from',
        'X-Xcnam-Sensitive-Phone-Number-To' => 'x_xcnam_sensitive_phone_number_to',
    }
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://preview.twilio.com/TrustedComms/CurrentCall',
        headers: headers,
    ))).to eq(true)
  end

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

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

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
twilio-ruby-5.50.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.49.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.48.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.47.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.46.1 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.46.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.45.1 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.45.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.44.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.43.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.42.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.41.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.40.4 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.40.3 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.40.2 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.40.1 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.40.0 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.39.3 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.39.2 spec/integration/preview/trusted_comms/current_call_spec.rb
twilio-ruby-5.39.1 spec/integration/preview/trusted_comms/current_call_spec.rb