Sha256: dec9f09a7f59629758b20759d70c89f4d4ef2dad418510a7b70f7b72c5aa3685

Contents?: true

Size: 1.67 KB

Versions: 9

Compression:

Stored size: 1.67 KB

Contents

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

require 'spec_helper.rb'

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

    expect {
      @client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                         .summary().fetch()
    }.to raise_exception(Twilio::REST::TwilioError)

    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://insights.twilio.com/v1/Voice/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Summary',
    ))).to eq(true)
  end

  it "receives fetch responses" do
    @holodeck.mock(Twilio::Response.new(
        200,
      %q[
      {
          "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "call_type": "carrier",
          "call_state": "ringing",
          "processing_state": "complete",
          "start_time": "2015-07-30T20:00:00Z",
          "end_time": "2015-07-30T20:00:00Z",
          "duration": 100,
          "connect_duration": 99,
          "from": {},
          "to": {},
          "carrier_edge": {},
          "client_edge": {},
          "sdk_edge": {},
          "sip_edge": {},
          "tags": [
              "tags"
          ],
          "attributes": {},
          "properties": {},
          "url": "https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Summary"
      }
      ]
    ))

    actual = @client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                                .summary().fetch()

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
twilio-ruby-5.40.4 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.40.3 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.40.2 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.40.1 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.40.0 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.39.3 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.39.2 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.39.1 spec/integration/insights/v1/call/summary_spec.rb
twilio-ruby-5.39.0 spec/integration/insights/v1/call/summary_spec.rb