spec/unit/intercom/count_spec.rb in intercom-3.5.2 vs spec/unit/intercom/count_spec.rb in intercom-3.5.3
- old
+ new
@@ -12,6 +12,17 @@
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