Skip to content

Commit 19e92dc

Browse files
committed
Test global conversation count response
1 parent ce22a72 commit 19e92dc

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

spec/spec_helper.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,18 @@ def test_segment_count
448448
}
449449
end
450450

451+
def test_conversation_count
452+
{
453+
"type" => "count",
454+
"conversation" => {
455+
"assigned" => 1,
456+
"closed" => 15,
457+
"open" => 1,
458+
"unassigned" => 0
459+
}
460+
}
461+
end
462+
451463
def error_on_modify_frozen
452464
RUBY_VERSION =~ /1.8/ ? TypeError : RuntimeError
453465
end

spec/unit/intercom/count_spec.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@
1616
end
1717

1818
it 'should not include count param when nil' do
19-
client.expects(:get).with("/counts", {type: 'conversation'}).returns(test_segment_count)
19+
client.expects(:get).with("/counts", {type: 'conversation'}).returns(test_conversation_count)
2020
counts = client.counts.for_type(type: 'conversation')
21-
counts.user['segment'][4]["segment 1"].must_equal(1)
21+
counts.conversation.must_equal({
22+
"assigned" => 1,
23+
"closed" => 15,
24+
"open" => 1,
25+
"unassigned" => 0
26+
})
2227
end
2328
end

0 commit comments

Comments
 (0)