hubspot-ruby 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/hubspot-ruby.gemspec +42 -5
- data/lib/hubspot-ruby.rb +3 -0
- data/lib/hubspot/blog.rb +14 -48
- data/lib/hubspot/connection.rb +95 -0
- data/lib/hubspot/contact.rb +74 -91
- data/lib/hubspot/contact_list.rb +127 -0
- data/lib/hubspot/contact_properties.rb +12 -0
- data/lib/hubspot/deal.rb +29 -25
- data/lib/hubspot/exceptions.rb +2 -0
- data/lib/hubspot/form.rb +88 -4
- data/lib/hubspot/topic.rb +8 -24
- data/lib/hubspot/utils.rb +0 -51
- data/lib/hubspot/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/add_contacts_to_lists.yml +281 -0
- data/spec/fixtures/vcr_cassettes/contact_create.yml +34 -2
- data/spec/fixtures/vcr_cassettes/contact_create_existing_email.yml +34 -2
- data/spec/fixtures/vcr_cassettes/contact_create_invalid_email.yml +35 -3
- data/spec/fixtures/vcr_cassettes/contact_create_with_params.yml +34 -2
- data/spec/fixtures/vcr_cassettes/contact_destroy.yml +36 -4
- data/spec/fixtures/vcr_cassettes/contact_find_by_email_batch_mode.yml +509 -0
- data/spec/fixtures/vcr_cassettes/contact_find_by_id_batch_mode.yml +33 -0
- data/spec/fixtures/vcr_cassettes/contact_find_by_utk_batch_mode.yml +33 -0
- data/spec/fixtures/vcr_cassettes/contact_list_batch_find.yml +65 -0
- data/spec/fixtures/vcr_cassettes/contact_list_destroy.yml +63 -0
- data/spec/fixtures/vcr_cassettes/contact_list_example.yml +33 -0
- data/spec/fixtures/vcr_cassettes/contact_list_find.yml +96 -0
- data/spec/fixtures/vcr_cassettes/contact_list_refresh.yml +33 -0
- data/spec/fixtures/vcr_cassettes/contact_list_update.yml +36 -0
- data/spec/fixtures/vcr_cassettes/contacts_among_list.yml +189 -0
- data/spec/fixtures/vcr_cassettes/create_form.yml +39 -0
- data/spec/fixtures/vcr_cassettes/create_list.yml +36 -0
- data/spec/fixtures/vcr_cassettes/create_list_with_filters.yml +36 -0
- data/spec/fixtures/vcr_cassettes/deal_create.yml +29 -0
- data/spec/fixtures/vcr_cassettes/deal_find.yml +56 -0
- data/spec/fixtures/vcr_cassettes/destroy_deal.yml +110 -0
- data/spec/fixtures/vcr_cassettes/fail_to_create_form.yml +35 -0
- data/spec/fixtures/vcr_cassettes/fail_to_create_list.yml +35 -0
- data/spec/fixtures/vcr_cassettes/field_among_form.yml +34 -0
- data/spec/fixtures/vcr_cassettes/fields_among_form.yml +35 -0
- data/spec/fixtures/vcr_cassettes/find_all_contacts.yml +39 -0
- data/spec/fixtures/vcr_cassettes/find_all_dynamic_lists.yml +104 -0
- data/spec/fixtures/vcr_cassettes/find_all_forms.yml +15378 -0
- data/spec/fixtures/vcr_cassettes/find_all_lists.yml +138 -0
- data/spec/fixtures/vcr_cassettes/find_all_recent_contacts.yml +33 -0
- data/spec/fixtures/vcr_cassettes/find_all_stastic_lists.yml +21876 -0
- data/spec/fixtures/vcr_cassettes/form_destroy.yml +64 -0
- data/spec/fixtures/vcr_cassettes/form_example.yml +39 -0
- data/spec/fixtures/vcr_cassettes/form_find.yml +69 -0
- data/spec/fixtures/vcr_cassettes/form_submit_data.yml +130 -0
- data/spec/fixtures/vcr_cassettes/form_update.yml +77 -0
- data/spec/fixtures/vcr_cassettes/one_month_blog_posts_filter_state.yml +5168 -0
- data/spec/fixtures/vcr_cassettes/remove_contacts_from_lists.yml +315 -0
- data/spec/lib/hubspot/blog_spec.rb +4 -3
- data/spec/lib/hubspot/connection_spec.rb +112 -0
- data/spec/lib/hubspot/contact_list_spec.rb +249 -0
- data/spec/lib/hubspot/contact_properties_spec.rb +8 -0
- data/spec/lib/hubspot/contact_spec.rb +110 -54
- data/spec/lib/hubspot/deal_spec.rb +11 -0
- data/spec/lib/hubspot/form_spec.rb +157 -10
- data/spec/lib/hubspot/utils_spec.rb +0 -67
- data/spec/live/deals_integration_spec.rb +35 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/tests_helper.rb +17 -0
- metadata +70 -33
@@ -0,0 +1,249 @@
|
|
1
|
+
describe Hubspot::ContactList do
|
2
|
+
let(:example_contact_list_hash) do
|
3
|
+
VCR.use_cassette("contact_list_example", record: :none) do
|
4
|
+
HTTParty.get("https://api.hubapi.com/contacts/v1/lists/1?hapikey=demo").parsed_response
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:static_list) { Hubspot::ContactList.all(static: true, count: 3).last }
|
9
|
+
let(:dynamic_list) { Hubspot::ContactList.all(dynamic: true, count: 1).first }
|
10
|
+
|
11
|
+
let(:example_contact_hash) do
|
12
|
+
VCR.use_cassette("contact_example", record: :none) do
|
13
|
+
HTTParty.get("https://api.hubapi.com/contacts/v1/contact/email/testingapis@hubspot.com/profile?hapikey=demo").parsed_response
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#initialize' do
|
18
|
+
subject { Hubspot::ContactList.new(example_contact_list_hash) }
|
19
|
+
|
20
|
+
it { should be_an_instance_of Hubspot::ContactList }
|
21
|
+
its(:id) { should be_an(Integer) }
|
22
|
+
its(:portal_id) { should be_a(Integer) }
|
23
|
+
its(:name) { should_not be_empty }
|
24
|
+
its(:dynamic) { should be true }
|
25
|
+
its(:properties) { should be_a(Hash) }
|
26
|
+
end
|
27
|
+
|
28
|
+
before { Hubspot.configure(hapikey: "demo") }
|
29
|
+
|
30
|
+
describe '#contacts' do
|
31
|
+
cassette 'contacts_among_list'
|
32
|
+
|
33
|
+
let(:list) { Hubspot::ContactList.new(example_contact_list_hash) }
|
34
|
+
|
35
|
+
it 'returns by defaut 20 contact lists' do
|
36
|
+
expect(list.contacts.count).to eql 20
|
37
|
+
contact = list.contacts.first
|
38
|
+
expect(contact).to be_a(Hubspot::Contact)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'add default properties to the contacts returned' do
|
42
|
+
contact = list.contacts.first
|
43
|
+
expect(contact.email).to_not be_empty
|
44
|
+
end
|
45
|
+
|
46
|
+
expect_count_and_offset do |params|
|
47
|
+
Hubspot::ContactList.find(1).contacts(params)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '.create' do
|
52
|
+
subject{ Hubspot::ContactList.create!({ name: name }) }
|
53
|
+
|
54
|
+
context 'with all required parameters' do
|
55
|
+
cassette 'create_list'
|
56
|
+
|
57
|
+
let(:name) { 'testing list' }
|
58
|
+
it { should be_an_instance_of Hubspot::ContactList }
|
59
|
+
its(:id) { should be_an(Integer) }
|
60
|
+
its(:portal_id) { should be_an(Integer) }
|
61
|
+
its(:dynamic) { should be false }
|
62
|
+
|
63
|
+
context 'adding filters parameters' do
|
64
|
+
cassette 'create_list_with_filters'
|
65
|
+
|
66
|
+
it 'returns a ContactList object with filters set' do
|
67
|
+
name = 'list with filters'
|
68
|
+
filters_param = [[{ operator: "EQ", value: "@hubspot", property: "twitterhandle", type: "string"}]]
|
69
|
+
list_with_filters = Hubspot::ContactList.create!({ name: name, filters: filters_param })
|
70
|
+
expect(list_with_filters).to be_a(Hubspot::ContactList)
|
71
|
+
expect(list_with_filters.properties['filters']).to_not be_empty
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
context 'without all required parameters' do
|
77
|
+
cassette 'fail_to_create_list'
|
78
|
+
|
79
|
+
it 'raises an error' do
|
80
|
+
expect { Hubspot::ContactList.create!({ name: nil }) }.to raise_error(Hubspot::RequestError)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
describe '.all' do
|
86
|
+
context 'all list types' do
|
87
|
+
cassette 'find_all_lists'
|
88
|
+
|
89
|
+
it 'returns by defaut 20 contact lists' do
|
90
|
+
lists = Hubspot::ContactList.all
|
91
|
+
expect(lists.count).to eql 20
|
92
|
+
|
93
|
+
list = lists.first
|
94
|
+
expect(list).to be_a(Hubspot::ContactList)
|
95
|
+
expect(list.id).to be_an(Integer)
|
96
|
+
end
|
97
|
+
|
98
|
+
expect_count_and_offset { |params| Hubspot::ContactList.all(params) }
|
99
|
+
end
|
100
|
+
|
101
|
+
context 'static lists' do
|
102
|
+
cassette 'find_all_stastic_lists'
|
103
|
+
|
104
|
+
it 'returns by defaut all the static contact lists' do
|
105
|
+
lists = Hubspot::ContactList.all(static: true)
|
106
|
+
expect(lists.count).to be > 20
|
107
|
+
|
108
|
+
list = lists.first
|
109
|
+
expect(list).to be_a(Hubspot::ContactList)
|
110
|
+
expect(list.dynamic).to be false
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
context 'dynamic lists' do
|
115
|
+
cassette 'find_all_dynamic_lists'
|
116
|
+
|
117
|
+
it 'returns by defaut all the static contact lists' do
|
118
|
+
lists = Hubspot::ContactList.all(dynamic: true)
|
119
|
+
expect(lists.count).to be > 20
|
120
|
+
|
121
|
+
list = lists.first
|
122
|
+
expect(list).to be_a(Hubspot::ContactList)
|
123
|
+
expect(list.dynamic).to be true
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
describe '.find' do
|
129
|
+
context 'given an id' do
|
130
|
+
cassette "contact_list_find"
|
131
|
+
subject { Hubspot::ContactList.find(id) }
|
132
|
+
|
133
|
+
context 'when the contact list is found' do
|
134
|
+
let(:id) { 1 }
|
135
|
+
it { should be_an_instance_of Hubspot::ContactList }
|
136
|
+
its(:name) { should == 'twitterers' }
|
137
|
+
|
138
|
+
let(:id) { '1' }
|
139
|
+
it { should be_an_instance_of Hubspot::ContactList }
|
140
|
+
end
|
141
|
+
|
142
|
+
context 'Wrong parameter type given' do
|
143
|
+
it 'raises an error' do
|
144
|
+
expect { Hubspot::ContactList.find(static_list) }.to raise_error(Hubspot::InvalidParams)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
context 'when the contact list is not found' do
|
149
|
+
it 'raises an error' do
|
150
|
+
expect { Hubspot::ContactList.find(-1) }.to raise_error(Hubspot::RequestError)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
context 'given a list of ids' do
|
156
|
+
cassette "contact_list_batch_find"
|
157
|
+
|
158
|
+
it 'find lists of contacts' do
|
159
|
+
lists = Hubspot::ContactList.find([2,3,4])
|
160
|
+
list = lists.first
|
161
|
+
expect(list).to be_a(Hubspot::ContactList)
|
162
|
+
expect(list.id).to be == 2
|
163
|
+
expect(lists.second.id).to be == 3
|
164
|
+
expect(lists.last.id).to be == 4
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
describe '#add' do
|
170
|
+
cassette "add_contacts_to_lists"
|
171
|
+
|
172
|
+
context 'static list' do
|
173
|
+
it 'returns true if contacts have been added to the list' do
|
174
|
+
contact = Hubspot::Contact.all(count: 1).first
|
175
|
+
mock(Hubspot::Connection).post_json("/contacts/v1/lists/:list_id/add", {:params=>{:list_id=>4}, :body=>{:vids=>[contact.vid]}}) { { 'updated' => [contact.vid] } }
|
176
|
+
|
177
|
+
expect(static_list.add(contact)).to be true
|
178
|
+
end
|
179
|
+
|
180
|
+
it 'returns false if the contact already exists in the list' do
|
181
|
+
contact = static_list.contacts(count: 1).first
|
182
|
+
expect(static_list.add(contact)).to be false
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
context 'dynamic list' do
|
187
|
+
it 'raises error if try to add a contact to a dynamic list' do
|
188
|
+
contact = Hubspot::Contact.new(example_contact_hash)
|
189
|
+
expect { dynamic_list.add(contact) }.to raise_error(Hubspot::RequestError)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
describe '#remove' do
|
195
|
+
cassette "remove_contacts_from_lists"
|
196
|
+
|
197
|
+
context 'static list' do
|
198
|
+
it 'returns true if removes all contacts in batch mode' do
|
199
|
+
contacts = static_list.contacts(count: 2)
|
200
|
+
expect(static_list.remove([contacts.first, contacts.last])).to be true
|
201
|
+
end
|
202
|
+
|
203
|
+
it 'returns false if the contact cannot be removed' do
|
204
|
+
contact_not_present_in_list = Hubspot::Contact.new(example_contact_hash)
|
205
|
+
expect(static_list.remove(contact_not_present_in_list)).to be false
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
context 'dynamic list' do
|
210
|
+
it 'raises error if try to remove a contact from a dynamic list' do
|
211
|
+
contact = dynamic_list.contacts(recent: true, count: 1).first
|
212
|
+
expect { dynamic_list.remove(contact) }.to raise_error(Hubspot::RequestError)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
describe '#update!' do
|
218
|
+
cassette "contact_list_update"
|
219
|
+
|
220
|
+
let(:contact_list) { Hubspot::ContactList.new(example_contact_list_hash) }
|
221
|
+
let(:params) { { name: "update list name" } }
|
222
|
+
subject { contact_list.update!(params) }
|
223
|
+
|
224
|
+
it { should be_an_instance_of Hubspot::ContactList }
|
225
|
+
its(:name){ should == "update list name" }
|
226
|
+
end
|
227
|
+
|
228
|
+
describe '#destroy!' do
|
229
|
+
cassette "contact_list_destroy"
|
230
|
+
|
231
|
+
let(:contact_list) { Hubspot::ContactList.create!({ name: "newcontactlist_#{Time.now.to_i}"}) }
|
232
|
+
subject{ contact_list.destroy! }
|
233
|
+
it { should be_true }
|
234
|
+
|
235
|
+
it "should be destroyed" do
|
236
|
+
subject
|
237
|
+
contact_list.destroyed?.should be_true
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
describe '#refresh' do
|
242
|
+
cassette "contact_list_refresh"
|
243
|
+
|
244
|
+
let(:contact_list) { Hubspot::ContactList.new(example_contact_list_hash) }
|
245
|
+
subject { contact_list.refresh }
|
246
|
+
|
247
|
+
it { should be true }
|
248
|
+
end
|
249
|
+
end
|
@@ -38,8 +38,8 @@ describe Hubspot::Contact do
|
|
38
38
|
context "with an existing email" do
|
39
39
|
cassette "contact_create_existing_email"
|
40
40
|
let(:email){ "testingapis@hubspot.com" }
|
41
|
-
it "raises a
|
42
|
-
expect{ subject }.to raise_error Hubspot::
|
41
|
+
it "raises a RequestError" do
|
42
|
+
expect{ subject }.to raise_error Hubspot::RequestError
|
43
43
|
end
|
44
44
|
end
|
45
45
|
context "with an invalid email" do
|
@@ -52,89 +52,145 @@ describe Hubspot::Contact do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
describe ".find_by_email" do
|
55
|
-
|
56
|
-
|
55
|
+
context 'given an uniq email' do
|
56
|
+
cassette "contact_find_by_email"
|
57
|
+
subject{ Hubspot::Contact.find_by_email(email) }
|
58
|
+
|
59
|
+
context "when the contact is found" do
|
60
|
+
let(:email){ "testingapis@hubspot.com" }
|
61
|
+
it{ should be_an_instance_of Hubspot::Contact }
|
62
|
+
its(:vid){ should == 82325 }
|
63
|
+
end
|
57
64
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
65
|
+
context "when the contact cannot be found" do
|
66
|
+
it 'raises an error' do
|
67
|
+
expect { Hubspot::Contact.find_by_email('notacontact@test.com') }.to raise_error(Hubspot::RequestError)
|
68
|
+
end
|
69
|
+
end
|
62
70
|
end
|
63
71
|
|
64
|
-
context
|
65
|
-
|
66
|
-
|
72
|
+
context 'batch mode' do
|
73
|
+
cassette "contact_find_by_email_batch_mode"
|
74
|
+
|
75
|
+
it 'find lists of contacts' do
|
76
|
+
emails = ['testingapis@hubspot.com', 'testingapisawesomeandstuff@hubspot.com']
|
77
|
+
contacts = Hubspot::Contact.find_by_email(emails)
|
78
|
+
pending
|
79
|
+
end
|
67
80
|
end
|
68
81
|
end
|
69
82
|
|
70
83
|
describe ".find_by_id" do
|
71
|
-
|
72
|
-
|
84
|
+
context 'given an uniq id' do
|
85
|
+
cassette "contact_find_by_id"
|
86
|
+
subject{ Hubspot::Contact.find_by_id(vid) }
|
87
|
+
|
88
|
+
context "when the contact is found" do
|
89
|
+
let(:vid){ 82325 }
|
90
|
+
it{ should be_an_instance_of Hubspot::Contact }
|
91
|
+
its(:email){ should == "testingapis@hubspot.com" }
|
92
|
+
end
|
73
93
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
94
|
+
context "when the contact cannot be found" do
|
95
|
+
it 'raises an error' do
|
96
|
+
expect { Hubspot::Contact.find_by_id(9999999) }.to raise_error(Hubspot::RequestError)
|
97
|
+
end
|
98
|
+
end
|
78
99
|
end
|
79
100
|
|
80
|
-
context
|
81
|
-
|
82
|
-
|
101
|
+
context 'batch mode' do
|
102
|
+
cassette "contact_find_by_id_batch_mode"
|
103
|
+
|
104
|
+
# NOTE: error currently appends on API endpoint
|
105
|
+
it 'find lists of contacts' do
|
106
|
+
expect { Hubspot::Contact.find_by_id([82325]) }.to raise_error(Hubspot::ApiError)
|
107
|
+
end
|
83
108
|
end
|
84
109
|
end
|
85
110
|
|
86
111
|
describe ".find_by_utk" do
|
87
|
-
|
88
|
-
|
112
|
+
context 'given an uniq utk' do
|
113
|
+
cassette "contact_find_by_utk"
|
114
|
+
subject{ Hubspot::Contact.find_by_utk(utk) }
|
115
|
+
|
116
|
+
context "when the contact is found" do
|
117
|
+
let(:utk){ "f844d2217850188692f2610c717c2e9b" }
|
118
|
+
it{ should be_an_instance_of Hubspot::Contact }
|
119
|
+
its(:utk){ should == "f844d2217850188692f2610c717c2e9b" }
|
120
|
+
end
|
89
121
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
122
|
+
context "when the contact cannot be found" do
|
123
|
+
it 'raises an error' do
|
124
|
+
expect { Hubspot::Contact.find_by_utk("invalid") }.to raise_error(Hubspot::RequestError)
|
125
|
+
end
|
126
|
+
end
|
94
127
|
end
|
95
128
|
|
96
|
-
context
|
97
|
-
|
98
|
-
|
129
|
+
context 'batch mode' do
|
130
|
+
cassette "contact_find_by_utk_batch_mode"
|
131
|
+
|
132
|
+
it 'find lists of contacts' do
|
133
|
+
utks = ['f844d2217850188692f2610c717c2e9b', 'j94344d22178501692f2610c717c2e9b']
|
134
|
+
expect { Hubspot::Contact.find_by_utk(utks) }.to raise_error(Hubspot::ApiError)
|
135
|
+
end
|
99
136
|
end
|
100
137
|
end
|
101
138
|
|
102
139
|
|
103
140
|
describe '.all' do
|
104
|
-
|
141
|
+
context 'all contacts' do
|
142
|
+
cassette 'find_all_contacts'
|
105
143
|
|
106
|
-
|
107
|
-
|
144
|
+
it 'must get the contacts list' do
|
145
|
+
contacts = Hubspot::Contact.all
|
108
146
|
|
109
|
-
|
147
|
+
expect(contacts.size).to eql 20 # default page size
|
110
148
|
|
111
|
-
|
112
|
-
|
149
|
+
first = contacts.first
|
150
|
+
last = contacts.last
|
113
151
|
|
114
|
-
|
115
|
-
|
116
|
-
|
152
|
+
expect(first).to be_a Hubspot::Contact
|
153
|
+
expect(first.vid).to eql 154835
|
154
|
+
expect(first['firstname']).to eql 'HubSpot'
|
155
|
+
expect(first['lastname']).to eql 'Test'
|
117
156
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
157
|
+
expect(last).to be_a Hubspot::Contact
|
158
|
+
expect(last.vid).to eql 196199
|
159
|
+
expect(last['firstname']).to eql 'Eleanor'
|
160
|
+
expect(last['lastname']).to eql 'Morgan'
|
161
|
+
end
|
123
162
|
|
124
|
-
|
125
|
-
|
126
|
-
|
163
|
+
it 'must filter only 2 contacts' do
|
164
|
+
contacts = Hubspot::Contact.all(count: 2)
|
165
|
+
expect(contacts.size).to eql 2
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'it must offset the contacts' do
|
169
|
+
single_list = Hubspot::Contact.all(count: 1)
|
170
|
+
expect(single_list.size).to eql 1
|
171
|
+
first = single_list.first
|
172
|
+
|
173
|
+
second = Hubspot::Contact.all(count: 1, vidOffset: first.vid).first
|
174
|
+
expect(second.vid).to eql 196181
|
175
|
+
expect(second['firstname']).to eql 'Charles'
|
176
|
+
expect(second['lastname']).to eql 'Gowland'
|
177
|
+
end
|
127
178
|
end
|
128
179
|
|
129
|
-
|
130
|
-
|
131
|
-
expect(single_list.size).to eql 1
|
132
|
-
first = single_list.first
|
180
|
+
context 'recent contacts' do
|
181
|
+
cassette 'find_all_recent_contacts'
|
133
182
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
183
|
+
it 'must get the contacts list' do
|
184
|
+
contacts = Hubspot::Contact.all(recent: true)
|
185
|
+
expect(contacts.size).to eql 20
|
186
|
+
|
187
|
+
first, last = contacts.first, contacts.last
|
188
|
+
expect(first).to be_a Hubspot::Contact
|
189
|
+
expect(first.vid).to eql 263794
|
190
|
+
|
191
|
+
expect(last).to be_a Hubspot::Contact
|
192
|
+
expect(last.vid).to eql 263776
|
193
|
+
end
|
138
194
|
end
|
139
195
|
end
|
140
196
|
|