|
22 | 22 | 'User-Agent' => 'Ruby' |
23 | 23 | } |
24 | 24 | ) |
25 | | - .to_return(status: 200, body: load_json('contact'), headers: {}) |
| 25 | + .to_return(status: 200, body: load_contact_json('contact'), headers: {}) |
26 | 26 | end |
27 | 27 |
|
28 | 28 | let(:response) { described_class.get_contact('701') } |
|
45 | 45 | 'User-Agent' => 'Ruby' |
46 | 46 | } |
47 | 47 | ) |
48 | | - .to_return(status: 200, body: load_json('contact'), headers: {}) |
| 48 | + .to_return(status: 200, body: load_contact_json('contact'), headers: {}) |
49 | 49 | end |
50 | 50 |
|
51 | 51 | let(:response) { described_class.get_contact('[email protected]') } |
|
70 | 70 | 'User-Agent' => 'Ruby' |
71 | 71 | } |
72 | 72 | ) |
73 | | - .to_return(status: 200, body: load_json('contacts'), headers: {}) |
| 73 | + .to_return(status: 200, body: load_contact_json('contacts'), headers: {}) |
74 | 74 | end |
75 | 75 |
|
76 | 76 | let(:response) { described_class.get_contacts } |
|
95 | 95 | 'User-Agent' => 'Ruby' |
96 | 96 | } |
97 | 97 | ) |
98 | | - .to_return(status: 201, body: load_json('create_contact'), headers: {}) |
| 98 | + .to_return(status: 201, body: load_contact_json('create_contact'), headers: {}) |
99 | 99 | end |
100 | 100 |
|
101 | 101 | let(:body) do |
|
125 | 125 | 'User-Agent' => 'Ruby' |
126 | 126 | } |
127 | 127 | ) |
128 | | - .to_return(status: 200, body: load_json('update_contact'), headers: {}) |
| 128 | + .to_return(status: 200, body: load_contact_json('update_contact'), headers: {}) |
129 | 129 | end |
130 | 130 |
|
131 | 131 | let(:body) do |
|
154 | 154 | 'User-Agent' => 'Ruby' |
155 | 155 | } |
156 | 156 | ) |
157 | | - .to_return(status: 200, body: load_json('update_contact'), headers: {}) |
| 157 | + .to_return(status: 200, body: load_contact_json('update_contact'), headers: {}) |
158 | 158 | end |
159 | 159 |
|
160 | 160 | let(:body) do |
|
233 | 233 | 'User-Agent' => 'Ruby' |
234 | 234 | } |
235 | 235 | ) |
236 | | - .to_return(status: 400, body: load_json('duplicate_contact'), headers: {}) |
| 236 | + .to_return(status: 400, body: load_contact_json('duplicate_contact'), headers: {}) |
237 | 237 | end |
238 | 238 |
|
239 | 239 | let(:body) do |
|
260 | 260 | 'User-Agent' => 'Ruby' |
261 | 261 | } |
262 | 262 | ) |
263 | | - .to_return(status: 400, body: load_json('contact_not_found'), headers: {}) |
| 263 | + .to_return(status: 400, body: load_contact_json('contact_not_found'), headers: {}) |
264 | 264 | end |
265 | 265 |
|
266 | 266 | let(:body) do |
|
286 | 286 | 'User-Agent' => 'Ruby' |
287 | 287 | } |
288 | 288 | ) |
289 | | - .to_return(status: 404, body: load_json('contact_not_found'), headers: {}) |
| 289 | + .to_return(status: 404, body: load_contact_json('contact_not_found'), headers: {}) |
290 | 290 | end |
291 | 291 |
|
292 | 292 | let(:response) { described_class.get_contact('4040') } |
|
316 | 316 | 'User-Agent' => 'Ruby' |
317 | 317 | } |
318 | 318 | ) |
319 | | - .to_return(status: 200, body: load_json('contact'), headers: {}) |
| 319 | + .to_return(status: 200, body: load_contact_json('contact'), headers: {}) |
320 | 320 | stub_request(:patch, 'https://api.hubapi.com/crm/v3/objects/contacts/[email protected]?idProperty=email') |
321 | 321 | .with( |
322 | 322 | body: 'properties%5Bemail%5D=amber_becker%40quigley.io&properties%5Bfirstname%5D=Amber&properties%5Blastname%5D=Quigley&properties%5Bhs_content_membership_status%5D=inactive', |
|
328 | 328 | 'User-Agent' => 'Ruby' |
329 | 329 | } |
330 | 330 | ) |
331 | | - .to_return(status: 200, body: load_json('update_or_create_contact'), headers: {}) |
| 331 | + .to_return(status: 200, body: load_contact_json('update_or_create_contact'), headers: {}) |
332 | 332 | end |
333 | 333 |
|
334 | 334 | it 'updates the contact' do |
335 | | - expect(response).to eq JSON.parse load_json('update_or_create_contact'), symbolize_names: true |
| 335 | + expect(response).to eq JSON.parse load_contact_json('update_or_create_contact'), symbolize_names: true |
336 | 336 | end |
337 | 337 | end |
338 | 338 |
|
|
366 | 366 | 'User-Agent' => 'Ruby' |
367 | 367 | } |
368 | 368 | ) |
369 | | - .to_return(status: 200, body: load_json('update_or_create_post'), headers: {}) |
| 369 | + .to_return(status: 200, body: load_contact_json('update_or_create_post'), headers: {}) |
370 | 370 | end |
371 | 371 |
|
372 | 372 | it 'creates the contact' do |
373 | | - expect(response).to eq JSON.parse load_json('update_or_create_post'), symbolize_names: true |
| 373 | + expect(response).to eq JSON.parse load_contact_json('update_or_create_post'), symbolize_names: true |
374 | 374 | end |
375 | 375 | end |
376 | 376 | end |
|
0 commit comments