spec/unit/intercom/contact_spec.rb in intercom-2.5.4 vs spec/unit/intercom/contact_spec.rb in intercom-3.0.0b1

- old
+ new

@@ -1,25 +1,27 @@ require "spec_helper" describe "Intercom::Contact" do + let (:client) { Intercom::Client.new(app_id: 'app_id', api_key: 'api_key') } + it 'should not throw ArgumentErrors when there are no parameters' do - Intercom.expects(:post) - Intercom::Contact.create + client.expects(:post) + client.contacts.create end describe 'converting' do let(:contact) { Intercom::Contact.from_api(user_id: 'contact_id') } let(:user) { Intercom::User.from_api(id: 'user_id') } it do - Intercom.expects(:post).with( + client.expects(:post).with( "/contacts/convert", { contact: { user_id: contact.user_id }, - user: user.identity_hash + user: { 'id' => user.id } } ).returns(test_user) - contact.convert(user) + client.contacts.convert(contact, user) end end end