Sha256: aada4387bd23ebaa400e11b977295b38cd8e86d22a5f8c6cb3afcb62cf9dd9af

Contents?: true

Size: 1.71 KB

Versions: 13

Compression:

Stored size: 1.71 KB

Contents

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

require 'spec_helper.rb'

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

    expect {
      @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                                   .insights \
                                   .impressions_rate().fetch()
    }.to raise_exception(Twilio::REST::TwilioError)

    expect(
    @holodeck.has_request?(Holodeck::Request.new(
        method: 'get',
        url: 'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Insights/ImpressionsRate',
    ))).to eq(true)
  end

  it "receives fetch responses" do
    @holodeck.mock(Twilio::Response.new(
        200,
      %q[
      {
          "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "start": "2015-07-30T20:00:00Z",
          "end": "2015-07-30T21:00:00Z",
          "interval": "minute",
          "reports": {
              "impressions_rate": {
                  "timestamp": "2015-07-30T20:00:00",
                  "calls": 1200,
                  "impressions": 800
              }
          },
          "url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights/ImpressionsRate"
      }
      ]
    ))

    actual = @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                                          .insights \
                                          .impressions_rate().fetch()

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
twilio-ruby-5.44.0 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.43.0 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.42.0 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.41.0 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.40.4 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.40.3 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.40.2 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.40.1 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.40.0 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.39.3 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.39.2 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.39.1 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb
twilio-ruby-5.39.0 spec/integration/preview/trusted_comms/business/insights/impressions_rate_spec.rb