Sha256: 22119dcac6b53443d521723cd12742d5551052aa948941c2e4326317d0fb60b6

Contents?: true

Size: 1.93 KB

Versions: 32

Compression:

Stored size: 1.93 KB

Contents

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

require 'spec_helper.rb'

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

    expect {
      @client.preview.trusted_comms.branded_calls.create(from: 'from', to: 'to', reason: 'reason')
    }.to raise_exception(Twilio::REST::TwilioError)

    values = {'From' => 'from', 'To' => 'to', 'Reason' => 'reason', }
    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'post',
        url: 'https://preview.twilio.com/TrustedComms/Business/BrandedCalls',
        data: values,
    ))).to eq(true)
  end

  it "receives create responses" do
    @holodeck.mock(Twilio::Response.new(
        201,
      %q[
      {
          "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "bg_color": "#fff",
          "brand_sid": "BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "branded_channel_sid": "BWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "caller": "Owl Bank",
          "created_at": "2019-05-01T20:00:00Z",
          "font_color": "#000",
          "from": "+15000000000",
          "logo": "https://www.twilio.com/marketing/bundles/company/img/logos/red/twilio-logo-red.png",
          "phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "reason": "Hello Jhon, your appointment has been confirmed.",
          "sid": "CQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "status": "unknown",
          "to": "+573000000000",
          "use_case": "conversational",
          "url": "https://preview.twilio.com/TrustedComms/Business/BrandedCalls"
      }
      ]
    ))

    actual = @client.preview.trusted_comms.branded_calls.create(from: 'from', to: 'to', reason: 'reason')

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

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
twilio-ruby-5.44.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.43.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.42.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.41.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.40.4 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.40.3 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.40.2 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.40.1 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.40.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.39.3 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.39.2 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.39.1 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.39.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.38.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.37.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.36.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.35.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.34.1 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.34.0 spec/integration/preview/trusted_comms/branded_call_spec.rb
twilio-ruby-5.33.1 spec/integration/preview/trusted_comms/branded_call_spec.rb