Sha256: 77b822ece3522098926da02b1481afe1978993648932464ac406416ff02cf283

Contents?: true

Size: 593 Bytes

Versions: 12

Compression:

Stored size: 593 Bytes

Contents

require "spec_helper"

describe "Intercom::Count" do
  let (:client) { Intercom::Client.new(app_id: 'app_id',  api_key: 'api_key') }

  it 'should get app wide counts' do
    client.expects(:get).with("/counts", {}).returns(test_app_count)
    counts = client.counts.for_app
    counts.tag['count'].must_equal(341)
  end

  it 'should get type counts' do
    client.expects(:get).with("/counts", {type: 'user', count: 'segment'}).returns(test_segment_count)
    counts = client.counts.for_type(type: 'user', count: 'segment')
    counts.user['segment'][4]["segment 1"].must_equal(1)
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
intercom-3.5.2 spec/unit/intercom/count_spec.rb
intercom-3.5.1 spec/unit/intercom/count_spec.rb
intercom-3.4.0 spec/unit/intercom/count_spec.rb
intercom-3.3.0 spec/unit/intercom/count_spec.rb
intercom-3.2.0 spec/unit/intercom/count_spec.rb
intercom-3.1.0 spec/unit/intercom/count_spec.rb
intercom-3.0.6 spec/unit/intercom/count_spec.rb
intercom-3.0.5 spec/unit/intercom/count_spec.rb
intercom-3.0.4 spec/unit/intercom/count_spec.rb
intercom-3.0.3 spec/unit/intercom/count_spec.rb
intercom-3.0.2 spec/unit/intercom/count_spec.rb
intercom-3.0.0 spec/unit/intercom/count_spec.rb