File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 44require 'intercom/api_operations/find_all'
55require 'intercom/api_operations/save'
66require 'intercom/api_operations/convert'
7+ require 'intercom/api_operations/delete'
78
89module Intercom
910 module Service
@@ -14,6 +15,7 @@ class Contact < BaseService
1415 include ApiOperations ::FindAll
1516 include ApiOperations ::Save
1617 include ApiOperations ::Convert
18+ include ApiOperations ::Delete
1719
1820 def collection_class
1921 Intercom ::Contact
Original file line number Diff line number Diff line change 3737 client . contacts . convert ( contact , user )
3838 end
3939 end
40+
41+ it "returns a ClientCollectionProxy for all without making any requests" do
42+ client . expects ( :execute_request ) . never
43+ all = client . contacts . all
44+ all . must_be_instance_of ( Intercom ::ClientCollectionProxy )
45+ end
46+
47+ it "deletes a contact" do
48+ contact = Intercom ::Contact . new ( "id" => "1" )
49+ client . expects ( :delete ) . with ( "/contacts/1" , { } ) . returns ( contact )
50+ client . contacts . delete ( contact )
51+ end
52+
4053end
You can’t perform that action at this time.
0 commit comments