Skip to content

Commit

Permalink
Add spec for find all on conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanHealy33 committed Dec 16, 2022
1 parent e9ae4b2 commit e640a2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/unit/intercom/company_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
_(proc { client.companies.find(:company_id => "4")}).must_raise Intercom::HttpError
end

it "on find_all" do
it "on all" do
client.expects(:get).with("/companies", {}).returns(nil)
_(proc { client.companies.all.each {|company| }}).must_raise Intercom::HttpError
end
Expand Down
5 changes: 5 additions & 0 deletions spec/unit/intercom/conversation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
client.conversations.all.each { |c| }
end

it "can filter conversations based on params" do
client.expects(:get).with("/conversations", {type: 'user', intercom_user_id: '123456789'}).returns(test_conversation_list)
client.conversations.find_all(type: 'user', intercom_user_id: '123456789').each { |c| }
end

it 'marks a conversation as read' do
client.expects(:put).with('/conversations/147', { read: true })
client.conversations.mark_read('147')
Expand Down

0 comments on commit e640a2d

Please sign in to comment.