Skip to content

Allow companies to be deleted #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/intercom/service/company.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'intercom/service/base_service'
require 'intercom/api_operations/delete'
require 'intercom/api_operations/list'
require 'intercom/api_operations/scroll'
require 'intercom/api_operations/find'
Expand All @@ -11,6 +12,7 @@
module Intercom
module Service
class Company < BaseService
include ApiOperations::Delete
include ApiOperations::Find
include ApiOperations::FindAll
include ApiOperations::Load
Expand Down
6 changes: 6 additions & 0 deletions spec/unit/intercom/company_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@
_(proxy.url).must_equal '/companies/1/contacts'
_(proxy.resource_class).must_equal Intercom::Contact
end

it "deletes a company" do
company = Intercom::Company.new("id" => "1")
client.expects(:delete).with("/companies/1", {})
client.companies.delete(company)
end
end