Sha256: 4d6d5f59e6dac7c27c1e115090706bc43e7012de2db3ca5939a7e0dc689d76d1

Contents?: true

Size: 496 Bytes

Versions: 8

Compression:

Stored size: 496 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Intercom::ClientCollectionProxy do
  let(:client) { Intercom::Client.new(token: 'token') }
  let(:lead_json) do
    { 'type' => 'contact.list', 'contacts' => [{ 'type' => 'contact', 'id' => 'id' }] }
  end

  it 'stops iterating if no next link' do
    client.expects(:get).with('/contacts', {}).returns(lead_json)
    client.deprecated__leads.all.each do |company|
      _(company.class).must_equal Intercom::Lead
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
intercom-4.2.1 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb
intercom-4.2.0 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb
intercom-4.1.3 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb
intercom-4.1.2 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb
intercom-4.1.1 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb
intercom-4.1.0 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb
intercom-4.0.1 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb
intercom-4.0.0 spec/unit/intercom/deprecated_leads_collection_proxy_spec.rb