Sha256: 6a56cf65c1cf728bef87675a7742fd9dca34bbf23c63106c0467f3853e008734
Contents?: true
Size: 938 Bytes
Versions: 40
Compression:
Stored size: 938 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 it 'should not include count param when nil' do client.expects(:get).with("/counts", {type: 'conversation'}).returns(test_conversation_count) counts = client.counts.for_type(type: 'conversation') counts.conversation.must_equal({ "assigned" => 1, "closed" => 15, "open" => 1, "unassigned" => 0 }) end end
Version data entries
40 entries across 40 versions & 1 rubygems