constantcontact 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/constantcontact.gemspec +4 -5
- data/lib/constantcontact/version.rb +1 -1
- data/spec/constantcontact/api_spec.rb +104 -104
- data/spec/constantcontact/sdk_spec.rb +1 -1
- data/spec/constantcontact/services/account_service_spec.rb +2 -2
- data/spec/constantcontact/services/activity_service_spec.rb +9 -9
- data/spec/constantcontact/services/base_service_spec.rb +5 -5
- data/spec/constantcontact/services/campaign_schedule_service_spec.rb +7 -7
- data/spec/constantcontact/services/campaign_tracking_service_spec.rb +7 -7
- data/spec/constantcontact/services/contact_service_spec.rb +10 -10
- data/spec/constantcontact/services/contact_tracking_service_spec.rb +7 -7
- data/spec/constantcontact/services/email_marketing_spec.rb +7 -7
- data/spec/constantcontact/services/event_spot_spec.rb +31 -31
- data/spec/constantcontact/services/library_service_spec.rb +19 -19
- data/spec/constantcontact/services/list_service_spec.rb +5 -5
- metadata +9 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 799047c75758d3d72428be76b027de4b26b2b5ac
|
4
|
+
data.tar.gz: 169153a9b2d919d969f59110f410522d7097ab8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5863e516e82e5ecea06d3cbcd03db3b0486f21408b04b8dd7ae8f25b142607b7c2d7e89b2ed8dd64cfaa26c8b6fbe5d27f84bed18fc0b51bfcc61c3557505cb7
|
7
|
+
data.tar.gz: 5907b24f1e7721f02c549d372feb865a313746f1ee2b758675160534281e1f3753f840393b60c4158d25b636ff1115faf45f6728491d97606a1e7ce8caf8d90f
|
data/README.md
CHANGED
@@ -5,11 +5,15 @@ The Ruby SDK for AppConnect allows you to leverage the AppConnect v2 APIs.
|
|
5
5
|
|
6
6
|
[![Build Status](https://travis-ci.org/constantcontact/ruby-sdk.png)](https://travis-ci.org/constantcontact/ruby-sdk)
|
7
7
|
|
8
|
+
Requirements
|
9
|
+
====
|
10
|
+
The Constant Contact Ruby SDK requires Ruby 2.2+.
|
11
|
+
|
8
12
|
Installation
|
9
13
|
====
|
10
14
|
Via bundler:
|
11
15
|
```ruby
|
12
|
-
gem 'constantcontact', '~>
|
16
|
+
gem 'constantcontact', '~> 4.0.0'
|
13
17
|
```
|
14
18
|
Otherwise:
|
15
19
|
```bash
|
data/constantcontact.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "constantcontact"
|
8
|
-
s.version = '
|
8
|
+
s.version = '4.0.0'
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.authors = ["ConstantContact"]
|
11
11
|
s.homepage = "http://www.constantcontact.com"
|
@@ -24,8 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.require_paths = [ "lib" ]
|
25
25
|
s.test_files = Dir['spec/**/*_spec.rb']
|
26
26
|
|
27
|
-
s.add_runtime_dependency("rest-client", '~>
|
28
|
-
s.add_runtime_dependency("json", '~>
|
29
|
-
s.
|
30
|
-
s.add_development_dependency("rspec", '~> 2.14')
|
27
|
+
s.add_runtime_dependency("rest-client", '~> 2.0')
|
28
|
+
s.add_runtime_dependency("json", '~> 2.1')
|
29
|
+
s.add_development_dependency("rspec", '~> 3.6')
|
31
30
|
end
|
@@ -70,7 +70,7 @@ describe ConstantContact::Api do
|
|
70
70
|
json_response = load_file('account_info_response.json')
|
71
71
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
72
72
|
|
73
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
73
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
74
74
|
RestClient.stub(:get).and_return(response)
|
75
75
|
|
76
76
|
result = @api.get_account_info()
|
@@ -84,7 +84,7 @@ describe ConstantContact::Api do
|
|
84
84
|
json_response = load_file('verified_email_addresses_response.json')
|
85
85
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
86
86
|
|
87
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
87
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
88
88
|
RestClient.stub(:get).and_return(response)
|
89
89
|
|
90
90
|
email_addresses = @api.get_verified_email_addresses()
|
@@ -100,7 +100,7 @@ describe ConstantContact::Api do
|
|
100
100
|
json_response = load_file('contacts_response.json')
|
101
101
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
102
102
|
|
103
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
103
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
104
104
|
RestClient.stub(:get).and_return(response)
|
105
105
|
contacts = @api.get_contacts({:limit => 60})
|
106
106
|
|
@@ -115,7 +115,7 @@ describe ConstantContact::Api do
|
|
115
115
|
json_response = load_file('contact_response.json')
|
116
116
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
117
117
|
|
118
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
118
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
119
119
|
RestClient.stub(:get).and_return(response)
|
120
120
|
contact = @api.get_contact(1)
|
121
121
|
|
@@ -128,7 +128,7 @@ describe ConstantContact::Api do
|
|
128
128
|
json_response = load_file('contacts_response.json')
|
129
129
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
130
130
|
|
131
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
131
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
132
132
|
RestClient.stub(:get).and_return(response)
|
133
133
|
contacts = @api.get_contact_by_email('rmartone@systems.com')
|
134
134
|
|
@@ -141,7 +141,7 @@ describe ConstantContact::Api do
|
|
141
141
|
json_response = load_file('contact_response.json')
|
142
142
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
143
143
|
|
144
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
144
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
145
145
|
RestClient.stub(:post).and_return(response)
|
146
146
|
new_contact = ConstantContact::Components::Contact.create(JSON.parse(json_response))
|
147
147
|
|
@@ -156,11 +156,11 @@ describe ConstantContact::Api do
|
|
156
156
|
contact_id = 196
|
157
157
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
158
158
|
|
159
|
-
response = RestClient::Response.create('', net_http_resp,
|
159
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
160
160
|
RestClient.stub(:delete).and_return(response)
|
161
161
|
|
162
162
|
result = @api.delete_contact(contact_id)
|
163
|
-
result.
|
163
|
+
expect(result).to eq true
|
164
164
|
end
|
165
165
|
end
|
166
166
|
|
@@ -169,11 +169,11 @@ describe ConstantContact::Api do
|
|
169
169
|
contact_id = 196
|
170
170
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
171
171
|
|
172
|
-
response = RestClient::Response.create('', net_http_resp,
|
172
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
173
173
|
RestClient.stub(:delete).and_return(response)
|
174
174
|
|
175
175
|
result = @api.delete_contact_from_lists(contact_id)
|
176
|
-
result.
|
176
|
+
expect(result).to eq true
|
177
177
|
end
|
178
178
|
end
|
179
179
|
|
@@ -183,11 +183,11 @@ describe ConstantContact::Api do
|
|
183
183
|
list_id = 1
|
184
184
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
185
185
|
|
186
|
-
response = RestClient::Response.create('', net_http_resp,
|
186
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
187
187
|
RestClient.stub(:delete).and_return(response)
|
188
188
|
|
189
189
|
result = @api.delete_contact_from_list(contact_id, list_id)
|
190
|
-
result.
|
190
|
+
expect(result).to eq true
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
@@ -196,7 +196,7 @@ describe ConstantContact::Api do
|
|
196
196
|
json = load_file('contact_response.json')
|
197
197
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
198
198
|
|
199
|
-
response = RestClient::Response.create(json, net_http_resp,
|
199
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
200
200
|
RestClient.stub(:put).and_return(response)
|
201
201
|
contact = ConstantContact::Components::Contact.create(JSON.parse(json))
|
202
202
|
result = @api.update_contact(contact)
|
@@ -211,7 +211,7 @@ describe ConstantContact::Api do
|
|
211
211
|
json_response = load_file('lists_response.json')
|
212
212
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
213
213
|
|
214
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
214
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
215
215
|
RestClient.stub(:get).and_return(response)
|
216
216
|
lists = @api.get_lists()
|
217
217
|
|
@@ -226,7 +226,7 @@ describe ConstantContact::Api do
|
|
226
226
|
json = load_file('list_response.json')
|
227
227
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
228
228
|
|
229
|
-
response = RestClient::Response.create(json, net_http_resp,
|
229
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
230
230
|
RestClient.stub(:get).and_return(response)
|
231
231
|
|
232
232
|
list = @api.get_list(1)
|
@@ -240,7 +240,7 @@ describe ConstantContact::Api do
|
|
240
240
|
json = load_file('list_response.json')
|
241
241
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
242
242
|
|
243
|
-
response = RestClient::Response.create(json, net_http_resp,
|
243
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
244
244
|
RestClient.stub(:post).and_return(response)
|
245
245
|
new_list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
246
246
|
|
@@ -255,7 +255,7 @@ describe ConstantContact::Api do
|
|
255
255
|
json = load_file('list_response.json')
|
256
256
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
257
257
|
|
258
|
-
response = RestClient::Response.create(json, net_http_resp,
|
258
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
259
259
|
RestClient.stub(:put).and_return(response)
|
260
260
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
261
261
|
|
@@ -271,7 +271,7 @@ describe ConstantContact::Api do
|
|
271
271
|
json_contacts = load_file('contacts_response.json')
|
272
272
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
273
273
|
|
274
|
-
response = RestClient::Response.create(json_contacts, net_http_resp,
|
274
|
+
response = RestClient::Response.create(json_contacts, net_http_resp, @request)
|
275
275
|
RestClient.stub(:get).and_return(response)
|
276
276
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json_list))
|
277
277
|
|
@@ -292,7 +292,7 @@ describe ConstantContact::Api do
|
|
292
292
|
json = load_file('events.json')
|
293
293
|
|
294
294
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
295
|
-
response = RestClient::Response.create(json, net_http_resp,
|
295
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
296
296
|
RestClient.stub(:get).and_return(response)
|
297
297
|
|
298
298
|
events = @api.get_events()
|
@@ -306,7 +306,7 @@ describe ConstantContact::Api do
|
|
306
306
|
json = load_file('event.json')
|
307
307
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
308
308
|
|
309
|
-
response = RestClient::Response.create(json, net_http_resp,
|
309
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
310
310
|
RestClient.stub(:get).and_return(response)
|
311
311
|
event = @api.get_event(1)
|
312
312
|
|
@@ -319,7 +319,7 @@ describe ConstantContact::Api do
|
|
319
319
|
json = load_file('event.json')
|
320
320
|
|
321
321
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
322
|
-
response = RestClient::Response.create(json, net_http_resp,
|
322
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
323
323
|
RestClient.stub(:post).and_return(response)
|
324
324
|
|
325
325
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -337,7 +337,7 @@ describe ConstantContact::Api do
|
|
337
337
|
hash["status"] = "ACTIVE"
|
338
338
|
|
339
339
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
340
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp,
|
340
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, @request)
|
341
341
|
RestClient.stub(:patch).and_return(response)
|
342
342
|
|
343
343
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -355,7 +355,7 @@ describe ConstantContact::Api do
|
|
355
355
|
hash["status"] = "CANCELLED"
|
356
356
|
|
357
357
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
358
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp,
|
358
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, @request)
|
359
359
|
RestClient.stub(:patch).and_return(response)
|
360
360
|
|
361
361
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -372,7 +372,7 @@ describe ConstantContact::Api do
|
|
372
372
|
fees_json = load_file('fees.json')
|
373
373
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
374
374
|
|
375
|
-
response = RestClient::Response.create(fees_json, net_http_resp,
|
375
|
+
response = RestClient::Response.create(fees_json, net_http_resp, @request)
|
376
376
|
RestClient.stub(:get).and_return(response)
|
377
377
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
378
378
|
fees = @api.get_event_fees(event)
|
@@ -390,7 +390,7 @@ describe ConstantContact::Api do
|
|
390
390
|
fee_json = load_file('fees.json')
|
391
391
|
|
392
392
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
393
|
-
response = RestClient::Response.create(fee_json, net_http_resp,
|
393
|
+
response = RestClient::Response.create(fee_json, net_http_resp, @request)
|
394
394
|
RestClient.stub(:get).and_return(response)
|
395
395
|
|
396
396
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -406,7 +406,7 @@ describe ConstantContact::Api do
|
|
406
406
|
fee_json = load_file('fee.json')
|
407
407
|
|
408
408
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
409
|
-
response = RestClient::Response.create(fee_json, net_http_resp,
|
409
|
+
response = RestClient::Response.create(fee_json, net_http_resp, @request)
|
410
410
|
RestClient.stub(:post).and_return(response)
|
411
411
|
|
412
412
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -425,7 +425,7 @@ describe ConstantContact::Api do
|
|
425
425
|
hash['fee'] += 1
|
426
426
|
|
427
427
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
428
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp,
|
428
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, @request)
|
429
429
|
RestClient.stub(:put).and_return(response)
|
430
430
|
|
431
431
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -443,12 +443,12 @@ describe ConstantContact::Api do
|
|
443
443
|
fee_json = load_file('fees.json')
|
444
444
|
|
445
445
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
446
|
-
response = RestClient::Response.create('', net_http_resp,
|
446
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
447
447
|
RestClient.stub(:delete).and_return(response)
|
448
448
|
|
449
449
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
450
450
|
fee = ConstantContact::Components::EventFee.create(JSON.parse(fee_json))
|
451
|
-
@api.delete_event_fee(event, fee).
|
451
|
+
expect(@api.delete_event_fee(event, fee)).to eq true
|
452
452
|
end
|
453
453
|
end
|
454
454
|
|
@@ -458,7 +458,7 @@ describe ConstantContact::Api do
|
|
458
458
|
registrants_json = load_file('registrants.json')
|
459
459
|
|
460
460
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
461
|
-
response = RestClient::Response.create(registrants_json, net_http_resp,
|
461
|
+
response = RestClient::Response.create(registrants_json, net_http_resp, @request)
|
462
462
|
RestClient.stub(:get).and_return(response)
|
463
463
|
|
464
464
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -474,7 +474,7 @@ describe ConstantContact::Api do
|
|
474
474
|
registrant_json = load_file('registrant.json')
|
475
475
|
|
476
476
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
477
|
-
response = RestClient::Response.create(registrant_json, net_http_resp,
|
477
|
+
response = RestClient::Response.create(registrant_json, net_http_resp, @request)
|
478
478
|
RestClient.stub(:get).and_return(response)
|
479
479
|
|
480
480
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -490,7 +490,7 @@ describe ConstantContact::Api do
|
|
490
490
|
json_response = load_file('event_items_response.json')
|
491
491
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
492
492
|
|
493
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
493
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
494
494
|
RestClient.stub(:get).and_return(response)
|
495
495
|
|
496
496
|
results = @api.get_event_items(1)
|
@@ -505,7 +505,7 @@ describe ConstantContact::Api do
|
|
505
505
|
json = load_file('event_item_response.json')
|
506
506
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
507
507
|
|
508
|
-
response = RestClient::Response.create(json, net_http_resp,
|
508
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
509
509
|
RestClient.stub(:get).and_return(response)
|
510
510
|
|
511
511
|
result = @api.get_event_item(1, 1)
|
@@ -519,7 +519,7 @@ describe ConstantContact::Api do
|
|
519
519
|
json = load_file('event_item_response.json')
|
520
520
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
521
521
|
|
522
|
-
response = RestClient::Response.create(json, net_http_resp,
|
522
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
523
523
|
RestClient.stub(:post).and_return(response)
|
524
524
|
event_item = ConstantContact::Components::EventItem.create(JSON.parse(json))
|
525
525
|
|
@@ -533,11 +533,11 @@ describe ConstantContact::Api do
|
|
533
533
|
it "deletes an event item" do
|
534
534
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
535
535
|
|
536
|
-
response = RestClient::Response.create('', net_http_resp,
|
536
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
537
537
|
RestClient.stub(:delete).and_return(response)
|
538
538
|
|
539
539
|
result = @api.delete_event_item(1, 1)
|
540
|
-
result.
|
540
|
+
expect(result).to eq true
|
541
541
|
end
|
542
542
|
end
|
543
543
|
|
@@ -546,7 +546,7 @@ describe ConstantContact::Api do
|
|
546
546
|
json = load_file('event_item_response.json')
|
547
547
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
548
548
|
|
549
|
-
response = RestClient::Response.create(json, net_http_resp,
|
549
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
550
550
|
RestClient.stub(:put).and_return(response)
|
551
551
|
event_item = ConstantContact::Components::EventItem.create(JSON.parse(json))
|
552
552
|
|
@@ -561,7 +561,7 @@ describe ConstantContact::Api do
|
|
561
561
|
json_response = load_file('event_item_attributes_response.json')
|
562
562
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
563
563
|
|
564
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
564
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
565
565
|
RestClient.stub(:get).and_return(response)
|
566
566
|
|
567
567
|
results = @api.get_event_item_attributes(1, 1)
|
@@ -576,7 +576,7 @@ describe ConstantContact::Api do
|
|
576
576
|
json = load_file('event_item_attribute_response.json')
|
577
577
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
578
578
|
|
579
|
-
response = RestClient::Response.create(json, net_http_resp,
|
579
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
580
580
|
RestClient.stub(:get).and_return(response)
|
581
581
|
|
582
582
|
result = @api.get_event_item_attribute(1, 1, 1)
|
@@ -590,7 +590,7 @@ describe ConstantContact::Api do
|
|
590
590
|
json = load_file('event_item_attribute_response.json')
|
591
591
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
592
592
|
|
593
|
-
response = RestClient::Response.create(json, net_http_resp,
|
593
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
594
594
|
RestClient.stub(:post).and_return(response)
|
595
595
|
event_item_attribute = ConstantContact::Components::EventItemAttribute.create(JSON.parse(json))
|
596
596
|
|
@@ -604,11 +604,11 @@ describe ConstantContact::Api do
|
|
604
604
|
it "deletes an event item attribute" do
|
605
605
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
606
606
|
|
607
|
-
response = RestClient::Response.create('', net_http_resp,
|
607
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
608
608
|
RestClient.stub(:delete).and_return(response)
|
609
609
|
|
610
610
|
result = @api.delete_event_item_attribute(1, 1, 1)
|
611
|
-
result.
|
611
|
+
expect(result).to eq true
|
612
612
|
end
|
613
613
|
end
|
614
614
|
|
@@ -617,7 +617,7 @@ describe ConstantContact::Api do
|
|
617
617
|
json = load_file('event_item_attribute_response.json')
|
618
618
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
619
619
|
|
620
|
-
response = RestClient::Response.create(json, net_http_resp,
|
620
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
621
621
|
RestClient.stub(:put).and_return(response)
|
622
622
|
event_item_attribute = ConstantContact::Components::EventItemAttribute.create(JSON.parse(json))
|
623
623
|
|
@@ -632,7 +632,7 @@ describe ConstantContact::Api do
|
|
632
632
|
json_response = load_file('promocodes_response.json')
|
633
633
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
634
634
|
|
635
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
635
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
636
636
|
RestClient.stub(:get).and_return(response)
|
637
637
|
|
638
638
|
results = @api.get_promocodes(1)
|
@@ -647,7 +647,7 @@ describe ConstantContact::Api do
|
|
647
647
|
json = load_file('promocode_response.json')
|
648
648
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
649
649
|
|
650
|
-
response = RestClient::Response.create(json, net_http_resp,
|
650
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
651
651
|
RestClient.stub(:get).and_return(response)
|
652
652
|
|
653
653
|
result = @api.get_promocode(1, 1)
|
@@ -661,7 +661,7 @@ describe ConstantContact::Api do
|
|
661
661
|
json = load_file('promocode_response.json')
|
662
662
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
663
663
|
|
664
|
-
response = RestClient::Response.create(json, net_http_resp,
|
664
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
665
665
|
RestClient.stub(:post).and_return(response)
|
666
666
|
promocode = ConstantContact::Components::Promocode.create(JSON.parse(json))
|
667
667
|
|
@@ -675,11 +675,11 @@ describe ConstantContact::Api do
|
|
675
675
|
it "deletes a promocode" do
|
676
676
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
677
677
|
|
678
|
-
response = RestClient::Response.create('', net_http_resp,
|
678
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
679
679
|
RestClient.stub(:delete).and_return(response)
|
680
680
|
|
681
681
|
result = @api.delete_promocode(1, 1)
|
682
|
-
result.
|
682
|
+
expect(result).to eq true
|
683
683
|
end
|
684
684
|
end
|
685
685
|
|
@@ -688,7 +688,7 @@ describe ConstantContact::Api do
|
|
688
688
|
json = load_file('promocode_response.json')
|
689
689
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
690
690
|
|
691
|
-
response = RestClient::Response.create(json, net_http_resp,
|
691
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
692
692
|
RestClient.stub(:put).and_return(response)
|
693
693
|
promocode = ConstantContact::Components::Promocode.create(JSON.parse(json))
|
694
694
|
|
@@ -703,7 +703,7 @@ describe ConstantContact::Api do
|
|
703
703
|
json_response = load_file('email_campaigns_response.json')
|
704
704
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
705
705
|
|
706
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
706
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
707
707
|
RestClient.stub(:get).and_return(response)
|
708
708
|
|
709
709
|
campaigns = @api.get_email_campaigns({:limit => 2})
|
@@ -718,7 +718,7 @@ describe ConstantContact::Api do
|
|
718
718
|
json_response = load_file('email_campaign_response.json')
|
719
719
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
720
720
|
|
721
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
721
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
722
722
|
RestClient.stub(:get).and_return(response)
|
723
723
|
|
724
724
|
campaign = @api.get_email_campaign(1)
|
@@ -732,7 +732,7 @@ describe ConstantContact::Api do
|
|
732
732
|
json_response = load_file('email_campaign_preview_response.json')
|
733
733
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
734
734
|
|
735
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
735
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
736
736
|
RestClient.stub(:get).and_return(response)
|
737
737
|
|
738
738
|
campaign_preview = @api.get_email_campaign_preview(1)
|
@@ -746,7 +746,7 @@ describe ConstantContact::Api do
|
|
746
746
|
json = load_file('email_campaign_response.json')
|
747
747
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
748
748
|
|
749
|
-
response = RestClient::Response.create(json, net_http_resp,
|
749
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
750
750
|
RestClient.stub(:post).and_return(response)
|
751
751
|
new_campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
752
752
|
|
@@ -761,12 +761,12 @@ describe ConstantContact::Api do
|
|
761
761
|
json = load_file('email_campaign_response.json')
|
762
762
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
763
763
|
|
764
|
-
response = RestClient::Response.create('', net_http_resp,
|
764
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
765
765
|
RestClient.stub(:delete).and_return(response)
|
766
766
|
campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
767
767
|
|
768
768
|
result = @api.delete_email_campaign(campaign)
|
769
|
-
result.
|
769
|
+
expect(result).to eq true
|
770
770
|
end
|
771
771
|
end
|
772
772
|
|
@@ -775,7 +775,7 @@ describe ConstantContact::Api do
|
|
775
775
|
json = load_file('email_campaign_response.json')
|
776
776
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
777
777
|
|
778
|
-
response = RestClient::Response.create(json, net_http_resp,
|
778
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
779
779
|
RestClient.stub(:put).and_return(response)
|
780
780
|
campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
781
781
|
|
@@ -791,7 +791,7 @@ describe ConstantContact::Api do
|
|
791
791
|
json = load_file('schedule_response.json')
|
792
792
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
793
793
|
|
794
|
-
response = RestClient::Response.create(json, net_http_resp,
|
794
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
795
795
|
RestClient.stub(:post).and_return(response)
|
796
796
|
new_schedule = ConstantContact::Components::Schedule.create(JSON.parse(json))
|
797
797
|
|
@@ -807,7 +807,7 @@ describe ConstantContact::Api do
|
|
807
807
|
json = load_file('schedules_response.json')
|
808
808
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
809
809
|
|
810
|
-
response = RestClient::Response.create(json, net_http_resp,
|
810
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
811
811
|
RestClient.stub(:get).and_return(response)
|
812
812
|
|
813
813
|
schedules = @api.get_email_campaign_schedules(campaign_id)
|
@@ -824,7 +824,7 @@ describe ConstantContact::Api do
|
|
824
824
|
json = load_file('schedule_response.json')
|
825
825
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
826
826
|
|
827
|
-
response = RestClient::Response.create(json, net_http_resp,
|
827
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
828
828
|
RestClient.stub(:get).and_return(response)
|
829
829
|
|
830
830
|
schedule = @api.get_email_campaign_schedule(campaign_id, schedule_id)
|
@@ -839,11 +839,11 @@ describe ConstantContact::Api do
|
|
839
839
|
schedule_id = 1
|
840
840
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
841
841
|
|
842
|
-
response = RestClient::Response.create('', net_http_resp,
|
842
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
843
843
|
RestClient.stub(:delete).and_return(response)
|
844
844
|
|
845
845
|
result = @api.delete_email_campaign_schedule(campaign_id, schedule_id)
|
846
|
-
result.
|
846
|
+
expect(result).to eq true
|
847
847
|
end
|
848
848
|
end
|
849
849
|
|
@@ -853,7 +853,7 @@ describe ConstantContact::Api do
|
|
853
853
|
json = load_file('schedule_response.json')
|
854
854
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
855
855
|
|
856
|
-
response = RestClient::Response.create(json, net_http_resp,
|
856
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
857
857
|
RestClient.stub(:put).and_return(response)
|
858
858
|
schedule = ConstantContact::Components::Schedule.create(JSON.parse(json))
|
859
859
|
|
@@ -870,7 +870,7 @@ describe ConstantContact::Api do
|
|
870
870
|
json_response = load_file('test_send_response.json')
|
871
871
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
872
872
|
|
873
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
873
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
874
874
|
RestClient.stub(:post).and_return(response)
|
875
875
|
test_send = ConstantContact::Components::TestSend.create(JSON.parse(json_request))
|
876
876
|
|
@@ -887,7 +887,7 @@ describe ConstantContact::Api do
|
|
887
887
|
json = load_file('campaign_tracking_bounces_response.json')
|
888
888
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
889
889
|
|
890
|
-
response = RestClient::Response.create(json, net_http_resp,
|
890
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
891
891
|
RestClient.stub(:get).and_return(response)
|
892
892
|
|
893
893
|
set = @api.get_email_campaign_bounces(campaign_id, params)
|
@@ -904,7 +904,7 @@ describe ConstantContact::Api do
|
|
904
904
|
json = load_file('campaign_tracking_clicks_response.json')
|
905
905
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
906
906
|
|
907
|
-
response = RestClient::Response.create(json, net_http_resp,
|
907
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
908
908
|
RestClient.stub(:get).and_return(response)
|
909
909
|
|
910
910
|
set = @api.get_email_campaign_clicks(campaign_id, params)
|
@@ -921,7 +921,7 @@ describe ConstantContact::Api do
|
|
921
921
|
json = load_file('campaign_tracking_forwards_response.json')
|
922
922
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
923
923
|
|
924
|
-
response = RestClient::Response.create(json, net_http_resp,
|
924
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
925
925
|
RestClient.stub(:get).and_return(response)
|
926
926
|
|
927
927
|
set = @api.get_email_campaign_forwards(campaign_id, params)
|
@@ -938,7 +938,7 @@ describe ConstantContact::Api do
|
|
938
938
|
json = load_file('campaign_tracking_opens_response.json')
|
939
939
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
940
940
|
|
941
|
-
response = RestClient::Response.create(json, net_http_resp,
|
941
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
942
942
|
RestClient.stub(:get).and_return(response)
|
943
943
|
|
944
944
|
set = @api.get_email_campaign_opens(campaign_id, params)
|
@@ -955,7 +955,7 @@ describe ConstantContact::Api do
|
|
955
955
|
json = load_file('campaign_tracking_sends_response.json')
|
956
956
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
957
957
|
|
958
|
-
response = RestClient::Response.create(json, net_http_resp,
|
958
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
959
959
|
RestClient.stub(:get).and_return(response)
|
960
960
|
|
961
961
|
set = @api.get_email_campaign_sends(campaign_id, params)
|
@@ -972,7 +972,7 @@ describe ConstantContact::Api do
|
|
972
972
|
json = load_file('campaign_tracking_unsubscribes_response.json')
|
973
973
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
974
974
|
|
975
|
-
response = RestClient::Response.create(json, net_http_resp,
|
975
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
976
976
|
RestClient.stub(:get).and_return(response)
|
977
977
|
|
978
978
|
set = @api.get_email_campaign_unsubscribes(campaign_id, params)
|
@@ -988,7 +988,7 @@ describe ConstantContact::Api do
|
|
988
988
|
json = load_file('campaign_tracking_summary_response.json')
|
989
989
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
990
990
|
|
991
|
-
response = RestClient::Response.create(json, net_http_resp,
|
991
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
992
992
|
RestClient.stub(:get).and_return(response)
|
993
993
|
|
994
994
|
summary = @api.get_email_campaign_summary_report(campaign_id)
|
@@ -1004,7 +1004,7 @@ describe ConstantContact::Api do
|
|
1004
1004
|
json = load_file('contact_tracking_bounces_response.json')
|
1005
1005
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1006
1006
|
|
1007
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1007
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1008
1008
|
RestClient.stub(:get).and_return(response)
|
1009
1009
|
|
1010
1010
|
set = @api.get_contact_bounces(contact_id, params)
|
@@ -1021,7 +1021,7 @@ describe ConstantContact::Api do
|
|
1021
1021
|
json = load_file('contact_tracking_clicks_response.json')
|
1022
1022
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1023
1023
|
|
1024
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1024
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1025
1025
|
RestClient.stub(:get).and_return(response)
|
1026
1026
|
|
1027
1027
|
set = @api.get_contact_clicks(contact_id, params)
|
@@ -1038,7 +1038,7 @@ describe ConstantContact::Api do
|
|
1038
1038
|
json = load_file('contact_tracking_forwards_response.json')
|
1039
1039
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1040
1040
|
|
1041
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1041
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1042
1042
|
RestClient.stub(:get).and_return(response)
|
1043
1043
|
|
1044
1044
|
set = @api.get_contact_forwards(contact_id, params)
|
@@ -1055,7 +1055,7 @@ describe ConstantContact::Api do
|
|
1055
1055
|
json = load_file('contact_tracking_opens_response.json')
|
1056
1056
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1057
1057
|
|
1058
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1058
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1059
1059
|
RestClient.stub(:get).and_return(response)
|
1060
1060
|
|
1061
1061
|
set = @api.get_contact_opens(contact_id, params)
|
@@ -1072,7 +1072,7 @@ describe ConstantContact::Api do
|
|
1072
1072
|
json = load_file('contact_tracking_sends_response.json')
|
1073
1073
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1074
1074
|
|
1075
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1075
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1076
1076
|
RestClient.stub(:get).and_return(response)
|
1077
1077
|
|
1078
1078
|
set = @api.get_contact_sends(contact_id, params)
|
@@ -1089,7 +1089,7 @@ describe ConstantContact::Api do
|
|
1089
1089
|
json = load_file('contact_tracking_unsubscribes_response.json')
|
1090
1090
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1091
1091
|
|
1092
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1092
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1093
1093
|
RestClient.stub(:get).and_return(response)
|
1094
1094
|
|
1095
1095
|
set = @api.get_contact_unsubscribes(contact_id, params)
|
@@ -1105,7 +1105,7 @@ describe ConstantContact::Api do
|
|
1105
1105
|
json = load_file('contact_tracking_summary_response.json')
|
1106
1106
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1107
1107
|
|
1108
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1108
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1109
1109
|
RestClient.stub(:get).and_return(response)
|
1110
1110
|
|
1111
1111
|
summary = @api.get_contact_summary_report(contact_id)
|
@@ -1119,7 +1119,7 @@ describe ConstantContact::Api do
|
|
1119
1119
|
json_response = load_file('activities_response.json')
|
1120
1120
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1121
1121
|
|
1122
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1122
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1123
1123
|
RestClient.stub(:get).and_return(response)
|
1124
1124
|
|
1125
1125
|
activities = @api.get_activities()
|
@@ -1133,7 +1133,7 @@ describe ConstantContact::Api do
|
|
1133
1133
|
json_response = load_file('activity_response.json')
|
1134
1134
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1135
1135
|
|
1136
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1136
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1137
1137
|
RestClient.stub(:get).and_return(response)
|
1138
1138
|
|
1139
1139
|
activity = @api.get_activity('a07e1ilbm7shdg6ikeo')
|
@@ -1148,7 +1148,7 @@ describe ConstantContact::Api do
|
|
1148
1148
|
json_response = load_file('add_contacts_response.json')
|
1149
1149
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1150
1150
|
|
1151
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1151
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1152
1152
|
RestClient.stub(:post).and_return(response)
|
1153
1153
|
|
1154
1154
|
contacts = []
|
@@ -1239,7 +1239,7 @@ describe ConstantContact::Api do
|
|
1239
1239
|
lists = 'list1, list2'
|
1240
1240
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1241
1241
|
|
1242
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1242
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1243
1243
|
RestClient.stub(:post).and_return(response)
|
1244
1244
|
|
1245
1245
|
activity = @api.add_create_contacts_activity_from_file('contacts.txt', content, lists)
|
@@ -1258,7 +1258,7 @@ describe ConstantContact::Api do
|
|
1258
1258
|
|
1259
1259
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1260
1260
|
|
1261
|
-
response = RestClient::Response.create(json_clear_lists, net_http_resp,
|
1261
|
+
response = RestClient::Response.create(json_clear_lists, net_http_resp, @request)
|
1262
1262
|
RestClient.stub(:post).and_return(response)
|
1263
1263
|
|
1264
1264
|
activity = @api.add_clear_lists_activity(lists)
|
@@ -1273,7 +1273,7 @@ describe ConstantContact::Api do
|
|
1273
1273
|
lists = 'list1, list2'
|
1274
1274
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1275
1275
|
|
1276
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1276
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1277
1277
|
RestClient.stub(:post).and_return(response)
|
1278
1278
|
email_addresses = ["djellesma@constantcontact.com"]
|
1279
1279
|
|
@@ -1291,7 +1291,7 @@ describe ConstantContact::Api do
|
|
1291
1291
|
lists = 'list1, list2'
|
1292
1292
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1293
1293
|
|
1294
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1294
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1295
1295
|
RestClient.stub(:post).and_return(response)
|
1296
1296
|
|
1297
1297
|
activity = @api.add_remove_contacts_from_lists_activity_from_file('contacts.txt', content, lists)
|
@@ -1306,7 +1306,7 @@ describe ConstantContact::Api do
|
|
1306
1306
|
json_response = load_file('export_contacts_response.json')
|
1307
1307
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1308
1308
|
|
1309
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1309
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1310
1310
|
RestClient.stub(:post).and_return(response)
|
1311
1311
|
export_contacts = ConstantContact::Components::ExportContacts.new(JSON.parse(json_request))
|
1312
1312
|
|
@@ -1321,7 +1321,7 @@ describe ConstantContact::Api do
|
|
1321
1321
|
json_response = load_file('library_info_response.json')
|
1322
1322
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1323
1323
|
|
1324
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1324
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1325
1325
|
RestClient.stub(:get).and_return(response)
|
1326
1326
|
|
1327
1327
|
info = @api.get_library_info()
|
@@ -1335,7 +1335,7 @@ describe ConstantContact::Api do
|
|
1335
1335
|
json_response = load_file('library_folders_response.json')
|
1336
1336
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1337
1337
|
|
1338
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1338
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1339
1339
|
RestClient.stub(:get).and_return(response)
|
1340
1340
|
|
1341
1341
|
folders = @api.get_library_folders({:limit => 2})
|
@@ -1350,7 +1350,7 @@ describe ConstantContact::Api do
|
|
1350
1350
|
json = load_file('library_folder_response.json')
|
1351
1351
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1352
1352
|
|
1353
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1353
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1354
1354
|
RestClient.stub(:post).and_return(response)
|
1355
1355
|
new_folder = ConstantContact::Components::LibraryFolder.create(JSON.parse(json))
|
1356
1356
|
|
@@ -1365,7 +1365,7 @@ describe ConstantContact::Api do
|
|
1365
1365
|
json = load_file('library_folder_response.json')
|
1366
1366
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1367
1367
|
|
1368
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1368
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1369
1369
|
RestClient.stub(:get).and_return(response)
|
1370
1370
|
|
1371
1371
|
folder = @api.get_library_folder(6)
|
@@ -1379,7 +1379,7 @@ describe ConstantContact::Api do
|
|
1379
1379
|
json = load_file('library_folder_response.json')
|
1380
1380
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1381
1381
|
|
1382
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1382
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1383
1383
|
RestClient.stub(:put).and_return(response)
|
1384
1384
|
folder = ConstantContact::Components::LibraryFolder.create(JSON.parse(json))
|
1385
1385
|
|
@@ -1394,11 +1394,11 @@ describe ConstantContact::Api do
|
|
1394
1394
|
folder_id = 6
|
1395
1395
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
1396
1396
|
|
1397
|
-
response = RestClient::Response.create('', net_http_resp,
|
1397
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
1398
1398
|
RestClient.stub(:delete).and_return(response)
|
1399
1399
|
|
1400
1400
|
result = @api.delete_library_folder(folder_id)
|
1401
|
-
result.
|
1401
|
+
expect(result).to eq true
|
1402
1402
|
end
|
1403
1403
|
end
|
1404
1404
|
|
@@ -1407,7 +1407,7 @@ describe ConstantContact::Api do
|
|
1407
1407
|
json = load_file('library_trash_response.json')
|
1408
1408
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1409
1409
|
|
1410
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1410
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1411
1411
|
RestClient.stub(:get).and_return(response)
|
1412
1412
|
|
1413
1413
|
files = @api.get_library_trash({:sort_by => 'SIZE_DESC'})
|
@@ -1421,11 +1421,11 @@ describe ConstantContact::Api do
|
|
1421
1421
|
it "permanently deletes all files in the Trash folder" do
|
1422
1422
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
1423
1423
|
|
1424
|
-
response = RestClient::Response.create('', net_http_resp,
|
1424
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
1425
1425
|
RestClient.stub(:delete).and_return(response)
|
1426
1426
|
|
1427
1427
|
result = @api.delete_library_trash()
|
1428
|
-
result.
|
1428
|
+
expect(result).to eq true
|
1429
1429
|
end
|
1430
1430
|
end
|
1431
1431
|
|
@@ -1434,7 +1434,7 @@ describe ConstantContact::Api do
|
|
1434
1434
|
json_response = load_file('library_files_response.json')
|
1435
1435
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1436
1436
|
|
1437
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1437
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1438
1438
|
RestClient.stub(:get).and_return(response)
|
1439
1439
|
|
1440
1440
|
files = @api.get_library_files({:type => 'ALL'})
|
@@ -1450,7 +1450,7 @@ describe ConstantContact::Api do
|
|
1450
1450
|
json_response = load_file('library_files_by_folder_response.json')
|
1451
1451
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1452
1452
|
|
1453
|
-
response = RestClient::Response.create(json_response, net_http_resp,
|
1453
|
+
response = RestClient::Response.create(json_response, net_http_resp, @request)
|
1454
1454
|
RestClient.stub(:get).and_return(response)
|
1455
1455
|
|
1456
1456
|
files = @api.get_library_files_by_folder(folder_id, {:limit => 10})
|
@@ -1465,7 +1465,7 @@ describe ConstantContact::Api do
|
|
1465
1465
|
json = load_file('library_file_response.json')
|
1466
1466
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1467
1467
|
|
1468
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1468
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1469
1469
|
RestClient.stub(:get).and_return(response)
|
1470
1470
|
|
1471
1471
|
file = @api.get_library_file(6)
|
@@ -1485,7 +1485,7 @@ describe ConstantContact::Api do
|
|
1485
1485
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1486
1486
|
net_http_resp.add_field('Location', '"https://api.d1.constantcontact.com/v2/library/files/123456789')
|
1487
1487
|
|
1488
|
-
response = RestClient::Response.create("", net_http_resp,
|
1488
|
+
response = RestClient::Response.create("", net_http_resp, @request)
|
1489
1489
|
RestClient.stub(:post).and_return(response)
|
1490
1490
|
|
1491
1491
|
response = @api.add_library_file(file_name, folder_id, description, source, file_type, contents)
|
@@ -1499,7 +1499,7 @@ describe ConstantContact::Api do
|
|
1499
1499
|
json = load_file('library_file_response.json')
|
1500
1500
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1501
1501
|
|
1502
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1502
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1503
1503
|
RestClient.stub(:put).and_return(response)
|
1504
1504
|
file = ConstantContact::Components::LibraryFile.create(JSON.parse(json))
|
1505
1505
|
|
@@ -1514,11 +1514,11 @@ describe ConstantContact::Api do
|
|
1514
1514
|
file_id = '6, 7'
|
1515
1515
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
1516
1516
|
|
1517
|
-
response = RestClient::Response.create('', net_http_resp,
|
1517
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
1518
1518
|
RestClient.stub(:delete).and_return(response)
|
1519
1519
|
|
1520
1520
|
result = @api.delete_library_file(file_id)
|
1521
|
-
result.
|
1521
|
+
expect(result).to eq true
|
1522
1522
|
end
|
1523
1523
|
end
|
1524
1524
|
|
@@ -1528,7 +1528,7 @@ describe ConstantContact::Api do
|
|
1528
1528
|
json = load_file('library_files_upload_status_response.json')
|
1529
1529
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1530
1530
|
|
1531
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1531
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1532
1532
|
RestClient.stub(:get).and_return(response)
|
1533
1533
|
|
1534
1534
|
statuses = @api.get_library_files_upload_status(file_id)
|
@@ -1545,7 +1545,7 @@ describe ConstantContact::Api do
|
|
1545
1545
|
json = load_file('library_files_move_results_response.json')
|
1546
1546
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1547
1547
|
|
1548
|
-
response = RestClient::Response.create(json, net_http_resp,
|
1548
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
1549
1549
|
RestClient.stub(:put).and_return(response)
|
1550
1550
|
|
1551
1551
|
results = @api.move_library_files(folder_id, file_id)
|