Skip to content

Commit e640a2d

Browse files
committed
Add spec for find all on conversations
1 parent e9ae4b2 commit e640a2d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

spec/unit/intercom/company_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_(proc { client.companies.find(:company_id => "4")}).must_raise Intercom::HttpError
1010
end
1111

12-
it "on find_all" do
12+
it "on all" do
1313
client.expects(:get).with("/companies", {}).returns(nil)
1414
_(proc { client.companies.all.each {|company| }}).must_raise Intercom::HttpError
1515
end

spec/unit/intercom/conversation_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
client.conversations.all.each { |c| }
1414
end
1515

16+
it "can filter conversations based on params" do
17+
client.expects(:get).with("/conversations", {type: 'user', intercom_user_id: '123456789'}).returns(test_conversation_list)
18+
client.conversations.find_all(type: 'user', intercom_user_id: '123456789').each { |c| }
19+
end
20+
1621
it 'marks a conversation as read' do
1722
client.expects(:put).with('/conversations/147', { read: true })
1823
client.conversations.mark_read('147')

0 commit comments

Comments
 (0)