constantcontact 2.0.0 → 2.0.1
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/README.md +1 -1
- data/constantcontact.gemspec +2 -2
- data/lib/constantcontact.rb +1 -0
- data/lib/constantcontact/auth/oauth2.rb +1 -1
- data/lib/constantcontact/components/account/account_address.rb +26 -0
- data/lib/constantcontact/components/account/account_info.rb +9 -2
- data/lib/constantcontact/version.rb +1 -1
- data/spec/constantcontact/api_spec.rb +94 -93
- data/spec/constantcontact/services/account_service_spec.rb +8 -2
- data/spec/constantcontact/services/activity_service_spec.rb +13 -9
- data/spec/constantcontact/services/campaign_schedule_service_spec.rb +10 -6
- data/spec/constantcontact/services/campaign_tracking_service_spec.rb +11 -7
- data/spec/constantcontact/services/contact_service_spec.rb +11 -7
- data/spec/constantcontact/services/contact_tracking_service_spec.rb +11 -7
- data/spec/constantcontact/services/email_marketing_spec.rb +9 -5
- data/spec/constantcontact/services/event_spot_spec.rb +31 -27
- data/spec/constantcontact/services/library_service_spec.rb +20 -16
- data/spec/constantcontact/services/list_service_spec.rb +9 -5
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4482ee218582fce3baff7aac752c2307bdba32d7
|
4
|
+
data.tar.gz: 748c1cbee8c014914d45af0742bd9518ee0542bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 154d1317c786da6b9716ff382ce55a1053bcb998906046d2fe2eea401b2006d9b7f9c2a31d10e6144e309cf20dc519df841cf5b46378b5cdd47b0fed647aed8b
|
7
|
+
data.tar.gz: 1a08e5af4474160624d8d020a19fe0a1f1938cdfae881b633021668e5f09538d4c61003ed97bae402602b2db40433b156e6e9aae644045196eefcb6d2e23a72c
|
data/README.md
CHANGED
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 = '2.0.
|
8
|
+
s.version = '2.0.1'
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.authors = ["ConstantContact"]
|
11
11
|
s.homepage = "http://www.constantcontact.com"
|
@@ -26,6 +26,6 @@ Gem::Specification.new do |s|
|
|
26
26
|
|
27
27
|
s.add_runtime_dependency("rest-client", '~> 1.6', '>= 1.6.7')
|
28
28
|
s.add_runtime_dependency("json", '~> 1.8', '>= 1.8.1')
|
29
|
-
s.add_runtime_dependency('mime-types', '~>
|
29
|
+
s.add_runtime_dependency('mime-types', '~> 2.4', '>= 2.4.1')
|
30
30
|
s.add_development_dependency("rspec", '~> 2.14')
|
31
31
|
end
|
data/lib/constantcontact.rb
CHANGED
@@ -52,6 +52,7 @@ module ConstantContact
|
|
52
52
|
autoload :TrackingSummary, 'constantcontact/components/tracking/tracking_summary'
|
53
53
|
autoload :VerifiedEmailAddress, 'constantcontact/components/account/verified_email_address'
|
54
54
|
autoload :AccountInfo, 'constantcontact/components/account/account_info'
|
55
|
+
autoload :AccountAddress, 'constantcontact/components/account/account_address'
|
55
56
|
autoload :Event, 'constantcontact/components/event_spot/event'
|
56
57
|
autoload :EventFee, 'constantcontact/components/event_spot/event_fee'
|
57
58
|
autoload :Registrant, 'constantcontact/components/event_spot/registrant'
|
@@ -71,7 +71,7 @@ module ConstantContact
|
|
71
71
|
response = RestClient.post(url, params)
|
72
72
|
response_body = JSON.parse(response)
|
73
73
|
rescue => e
|
74
|
-
response_body = e.respond_to?(:response) ?
|
74
|
+
response_body = e.respond_to?(:response) && e.response ?
|
75
75
|
JSON.parse(e.response) :
|
76
76
|
{'error' => '', 'error_description' => e.message}
|
77
77
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# account_address.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class AccountAddress < Component
|
10
|
+
attr_accessor :city, :country_code, :line1, :postal_code, :state_code
|
11
|
+
|
12
|
+
# Factory method to create an AccountAddress object from a json string
|
13
|
+
# @param [Hash] props - properties to create object from
|
14
|
+
# @return [AccountAddress]
|
15
|
+
def self.create(props)
|
16
|
+
obj = AccountAddress.new
|
17
|
+
if props
|
18
|
+
props.each do |key, value|
|
19
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
20
|
+
end
|
21
|
+
end
|
22
|
+
obj
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -7,7 +7,8 @@
|
|
7
7
|
module ConstantContact
|
8
8
|
module Components
|
9
9
|
class AccountInfo < Component
|
10
|
-
attr_accessor :website, :organization_name, :first_name, :last_name, :email, :phone, :country_code, :state_code
|
10
|
+
attr_accessor :website, :organization_name, :first_name, :last_name, :email, :phone, :country_code, :state_code,
|
11
|
+
:company_logo, :time_zone, :organization_addresses
|
11
12
|
|
12
13
|
# Class constructor
|
13
14
|
# @return [AccountInfo]
|
@@ -21,7 +22,13 @@ module ConstantContact
|
|
21
22
|
obj = AccountInfo.new
|
22
23
|
if props
|
23
24
|
props.each do |key, value|
|
24
|
-
|
25
|
+
key = key.to_s
|
26
|
+
if key == 'organization_addresses'
|
27
|
+
value = value || []
|
28
|
+
obj.organization_addresses = value.collect{|address| Components::AccountAddress.create(address) }
|
29
|
+
else
|
30
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
31
|
+
end
|
25
32
|
end
|
26
33
|
end
|
27
34
|
obj
|
@@ -8,13 +8,13 @@ require 'spec_helper'
|
|
8
8
|
|
9
9
|
describe ConstantContact::Api do
|
10
10
|
|
11
|
-
before(:all)
|
11
|
+
before(:all) do
|
12
12
|
ConstantContact::Util::Config.configure do |config|
|
13
13
|
config[:auth].delete :api_key
|
14
14
|
config[:auth].delete :api_secret
|
15
15
|
config[:auth].delete :redirect_uri
|
16
16
|
end
|
17
|
-
|
17
|
+
end
|
18
18
|
|
19
19
|
it "without api_key defined" do
|
20
20
|
lambda {
|
@@ -64,6 +64,7 @@ describe ConstantContact::Api do
|
|
64
64
|
describe "test methods" do
|
65
65
|
before(:each) do
|
66
66
|
@api = ConstantContact::Api.new('api key', 'access token')
|
67
|
+
@request = double('http request', :user => nil, :password => nil, :url => 'http://example.com', :redirection_history => nil)
|
67
68
|
end
|
68
69
|
|
69
70
|
describe "#get_account_info" do
|
@@ -71,7 +72,7 @@ describe ConstantContact::Api do
|
|
71
72
|
json_response = load_file('account_info_response.json')
|
72
73
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
73
74
|
|
74
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
75
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
75
76
|
RestClient.stub(:get).and_return(response)
|
76
77
|
|
77
78
|
result = @api.get_account_info()
|
@@ -85,7 +86,7 @@ describe ConstantContact::Api do
|
|
85
86
|
json_response = load_file('verified_email_addresses_response.json')
|
86
87
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
87
88
|
|
88
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
89
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
89
90
|
RestClient.stub(:get).and_return(response)
|
90
91
|
|
91
92
|
email_addresses = @api.get_verified_email_addresses()
|
@@ -101,7 +102,7 @@ describe ConstantContact::Api do
|
|
101
102
|
json_response = load_file('contacts_response.json')
|
102
103
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
103
104
|
|
104
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
105
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
105
106
|
RestClient.stub(:get).and_return(response)
|
106
107
|
contacts = @api.get_contacts({:limit => 60})
|
107
108
|
|
@@ -116,7 +117,7 @@ describe ConstantContact::Api do
|
|
116
117
|
json_response = load_file('contact_response.json')
|
117
118
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
118
119
|
|
119
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
120
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
120
121
|
RestClient.stub(:get).and_return(response)
|
121
122
|
contact = @api.get_contact(1)
|
122
123
|
|
@@ -129,7 +130,7 @@ describe ConstantContact::Api do
|
|
129
130
|
json_response = load_file('contacts_response.json')
|
130
131
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
131
132
|
|
132
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
133
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
133
134
|
RestClient.stub(:get).and_return(response)
|
134
135
|
contacts = @api.get_contact_by_email('rmartone@systems.com')
|
135
136
|
|
@@ -142,7 +143,7 @@ describe ConstantContact::Api do
|
|
142
143
|
json_response = load_file('contact_response.json')
|
143
144
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
144
145
|
|
145
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
146
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
146
147
|
RestClient.stub(:post).and_return(response)
|
147
148
|
new_contact = ConstantContact::Components::Contact.create(JSON.parse(json_response))
|
148
149
|
|
@@ -157,7 +158,7 @@ describe ConstantContact::Api do
|
|
157
158
|
contact_id = 196
|
158
159
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
159
160
|
|
160
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
161
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
161
162
|
RestClient.stub(:delete).and_return(response)
|
162
163
|
|
163
164
|
result = @api.delete_contact(contact_id)
|
@@ -170,7 +171,7 @@ describe ConstantContact::Api do
|
|
170
171
|
contact_id = 196
|
171
172
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
172
173
|
|
173
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
174
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
174
175
|
RestClient.stub(:delete).and_return(response)
|
175
176
|
|
176
177
|
result = @api.delete_contact_from_lists(contact_id)
|
@@ -184,7 +185,7 @@ describe ConstantContact::Api do
|
|
184
185
|
list_id = 1
|
185
186
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
186
187
|
|
187
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
188
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
188
189
|
RestClient.stub(:delete).and_return(response)
|
189
190
|
|
190
191
|
result = @api.delete_contact_from_list(contact_id, list_id)
|
@@ -197,7 +198,7 @@ describe ConstantContact::Api do
|
|
197
198
|
json = load_file('contact_response.json')
|
198
199
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
199
200
|
|
200
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
201
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
201
202
|
RestClient.stub(:put).and_return(response)
|
202
203
|
contact = ConstantContact::Components::Contact.create(JSON.parse(json))
|
203
204
|
result = @api.update_contact(contact)
|
@@ -212,7 +213,7 @@ describe ConstantContact::Api do
|
|
212
213
|
json_response = load_file('lists_response.json')
|
213
214
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
214
215
|
|
215
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
216
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
216
217
|
RestClient.stub(:get).and_return(response)
|
217
218
|
lists = @api.get_lists()
|
218
219
|
|
@@ -227,7 +228,7 @@ describe ConstantContact::Api do
|
|
227
228
|
json = load_file('list_response.json')
|
228
229
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
229
230
|
|
230
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
231
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
231
232
|
RestClient.stub(:get).and_return(response)
|
232
233
|
|
233
234
|
list = @api.get_list(1)
|
@@ -241,7 +242,7 @@ describe ConstantContact::Api do
|
|
241
242
|
json = load_file('list_response.json')
|
242
243
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
243
244
|
|
244
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
245
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
245
246
|
RestClient.stub(:post).and_return(response)
|
246
247
|
new_list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
247
248
|
|
@@ -256,7 +257,7 @@ describe ConstantContact::Api do
|
|
256
257
|
json = load_file('list_response.json')
|
257
258
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
258
259
|
|
259
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
260
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
260
261
|
RestClient.stub(:put).and_return(response)
|
261
262
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
262
263
|
|
@@ -272,7 +273,7 @@ describe ConstantContact::Api do
|
|
272
273
|
json_contacts = load_file('contacts_response.json')
|
273
274
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
274
275
|
|
275
|
-
response = RestClient::Response.create(json_contacts, net_http_resp, {})
|
276
|
+
response = RestClient::Response.create(json_contacts, net_http_resp, {}, @request)
|
276
277
|
RestClient.stub(:get).and_return(response)
|
277
278
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json_list))
|
278
279
|
|
@@ -293,7 +294,7 @@ describe ConstantContact::Api do
|
|
293
294
|
json = load_file('events.json')
|
294
295
|
|
295
296
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
296
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
297
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
297
298
|
RestClient.stub(:get).and_return(response)
|
298
299
|
|
299
300
|
events = @api.get_events()
|
@@ -307,7 +308,7 @@ describe ConstantContact::Api do
|
|
307
308
|
json = load_file('event.json')
|
308
309
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
309
310
|
|
310
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
311
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
311
312
|
RestClient.stub(:get).and_return(response)
|
312
313
|
event = @api.get_event(1)
|
313
314
|
|
@@ -320,7 +321,7 @@ describe ConstantContact::Api do
|
|
320
321
|
json = load_file('event.json')
|
321
322
|
|
322
323
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
323
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
324
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
324
325
|
RestClient.stub(:post).and_return(response)
|
325
326
|
|
326
327
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -338,7 +339,7 @@ describe ConstantContact::Api do
|
|
338
339
|
hash["status"] = "ACTIVE"
|
339
340
|
|
340
341
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
341
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp, {})
|
342
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, {}, @request)
|
342
343
|
RestClient.stub(:patch).and_return(response)
|
343
344
|
|
344
345
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -356,7 +357,7 @@ describe ConstantContact::Api do
|
|
356
357
|
hash["status"] = "CANCELLED"
|
357
358
|
|
358
359
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
359
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp, {})
|
360
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, {}, @request)
|
360
361
|
RestClient.stub(:patch).and_return(response)
|
361
362
|
|
362
363
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -373,7 +374,7 @@ describe ConstantContact::Api do
|
|
373
374
|
fees_json = load_file('fees.json')
|
374
375
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
375
376
|
|
376
|
-
response = RestClient::Response.create(fees_json, net_http_resp, {})
|
377
|
+
response = RestClient::Response.create(fees_json, net_http_resp, {}, @request)
|
377
378
|
RestClient.stub(:get).and_return(response)
|
378
379
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
379
380
|
fees = @api.get_event_fees(event)
|
@@ -391,7 +392,7 @@ describe ConstantContact::Api do
|
|
391
392
|
fee_json = load_file('fees.json')
|
392
393
|
|
393
394
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
394
|
-
response = RestClient::Response.create(fee_json, net_http_resp, {})
|
395
|
+
response = RestClient::Response.create(fee_json, net_http_resp, {}, @request)
|
395
396
|
RestClient.stub(:get).and_return(response)
|
396
397
|
|
397
398
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -407,7 +408,7 @@ describe ConstantContact::Api do
|
|
407
408
|
fee_json = load_file('fee.json')
|
408
409
|
|
409
410
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
410
|
-
response = RestClient::Response.create(fee_json, net_http_resp, {})
|
411
|
+
response = RestClient::Response.create(fee_json, net_http_resp, {}, @request)
|
411
412
|
RestClient.stub(:post).and_return(response)
|
412
413
|
|
413
414
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -426,7 +427,7 @@ describe ConstantContact::Api do
|
|
426
427
|
hash['fee'] += 1
|
427
428
|
|
428
429
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
429
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp, {})
|
430
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, {}, @request)
|
430
431
|
RestClient.stub(:put).and_return(response)
|
431
432
|
|
432
433
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -444,7 +445,7 @@ describe ConstantContact::Api do
|
|
444
445
|
fee_json = load_file('fees.json')
|
445
446
|
|
446
447
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
447
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
448
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
448
449
|
RestClient.stub(:delete).and_return(response)
|
449
450
|
|
450
451
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -459,7 +460,7 @@ describe ConstantContact::Api do
|
|
459
460
|
registrants_json = load_file('registrants.json')
|
460
461
|
|
461
462
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
462
|
-
response = RestClient::Response.create(registrants_json, net_http_resp, {})
|
463
|
+
response = RestClient::Response.create(registrants_json, net_http_resp, {}, @request)
|
463
464
|
RestClient.stub(:get).and_return(response)
|
464
465
|
|
465
466
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -475,7 +476,7 @@ describe ConstantContact::Api do
|
|
475
476
|
registrant_json = load_file('registrant.json')
|
476
477
|
|
477
478
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
478
|
-
response = RestClient::Response.create(registrant_json, net_http_resp, {})
|
479
|
+
response = RestClient::Response.create(registrant_json, net_http_resp, {}, @request)
|
479
480
|
RestClient.stub(:get).and_return(response)
|
480
481
|
|
481
482
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -491,7 +492,7 @@ describe ConstantContact::Api do
|
|
491
492
|
json_response = load_file('event_items_response.json')
|
492
493
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
493
494
|
|
494
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
495
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
495
496
|
RestClient.stub(:get).and_return(response)
|
496
497
|
|
497
498
|
results = @api.get_event_items(1)
|
@@ -506,7 +507,7 @@ describe ConstantContact::Api do
|
|
506
507
|
json = load_file('event_item_response.json')
|
507
508
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
508
509
|
|
509
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
510
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
510
511
|
RestClient.stub(:get).and_return(response)
|
511
512
|
|
512
513
|
result = @api.get_event_item(1, 1)
|
@@ -520,7 +521,7 @@ describe ConstantContact::Api do
|
|
520
521
|
json = load_file('event_item_response.json')
|
521
522
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
522
523
|
|
523
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
524
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
524
525
|
RestClient.stub(:post).and_return(response)
|
525
526
|
event_item = ConstantContact::Components::EventItem.create(JSON.parse(json))
|
526
527
|
|
@@ -534,7 +535,7 @@ describe ConstantContact::Api do
|
|
534
535
|
it "deletes an event item" do
|
535
536
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
536
537
|
|
537
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
538
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
538
539
|
RestClient.stub(:delete).and_return(response)
|
539
540
|
|
540
541
|
result = @api.delete_event_item(1, 1)
|
@@ -547,7 +548,7 @@ describe ConstantContact::Api do
|
|
547
548
|
json = load_file('event_item_response.json')
|
548
549
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
549
550
|
|
550
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
551
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
551
552
|
RestClient.stub(:put).and_return(response)
|
552
553
|
event_item = ConstantContact::Components::EventItem.create(JSON.parse(json))
|
553
554
|
|
@@ -562,7 +563,7 @@ describe ConstantContact::Api do
|
|
562
563
|
json_response = load_file('event_item_attributes_response.json')
|
563
564
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
564
565
|
|
565
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
566
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
566
567
|
RestClient.stub(:get).and_return(response)
|
567
568
|
|
568
569
|
results = @api.get_event_item_attributes(1, 1)
|
@@ -577,7 +578,7 @@ describe ConstantContact::Api do
|
|
577
578
|
json = load_file('event_item_attribute_response.json')
|
578
579
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
579
580
|
|
580
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
581
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
581
582
|
RestClient.stub(:get).and_return(response)
|
582
583
|
|
583
584
|
result = @api.get_event_item_attribute(1, 1, 1)
|
@@ -591,7 +592,7 @@ describe ConstantContact::Api do
|
|
591
592
|
json = load_file('event_item_attribute_response.json')
|
592
593
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
593
594
|
|
594
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
595
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
595
596
|
RestClient.stub(:post).and_return(response)
|
596
597
|
event_item_attribute = ConstantContact::Components::EventItemAttribute.create(JSON.parse(json))
|
597
598
|
|
@@ -605,7 +606,7 @@ describe ConstantContact::Api do
|
|
605
606
|
it "deletes an event item attribute" do
|
606
607
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
607
608
|
|
608
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
609
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
609
610
|
RestClient.stub(:delete).and_return(response)
|
610
611
|
|
611
612
|
result = @api.delete_event_item_attribute(1, 1, 1)
|
@@ -618,7 +619,7 @@ describe ConstantContact::Api do
|
|
618
619
|
json = load_file('event_item_attribute_response.json')
|
619
620
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
620
621
|
|
621
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
622
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
622
623
|
RestClient.stub(:put).and_return(response)
|
623
624
|
event_item_attribute = ConstantContact::Components::EventItemAttribute.create(JSON.parse(json))
|
624
625
|
|
@@ -633,7 +634,7 @@ describe ConstantContact::Api do
|
|
633
634
|
json_response = load_file('promocodes_response.json')
|
634
635
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
635
636
|
|
636
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
637
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
637
638
|
RestClient.stub(:get).and_return(response)
|
638
639
|
|
639
640
|
results = @api.get_promocodes(1)
|
@@ -648,7 +649,7 @@ describe ConstantContact::Api do
|
|
648
649
|
json = load_file('promocode_response.json')
|
649
650
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
650
651
|
|
651
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
652
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
652
653
|
RestClient.stub(:get).and_return(response)
|
653
654
|
|
654
655
|
result = @api.get_promocode(1, 1)
|
@@ -662,7 +663,7 @@ describe ConstantContact::Api do
|
|
662
663
|
json = load_file('promocode_response.json')
|
663
664
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
664
665
|
|
665
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
666
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
666
667
|
RestClient.stub(:post).and_return(response)
|
667
668
|
promocode = ConstantContact::Components::Promocode.create(JSON.parse(json))
|
668
669
|
|
@@ -676,7 +677,7 @@ describe ConstantContact::Api do
|
|
676
677
|
it "deletes a promocode" do
|
677
678
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
678
679
|
|
679
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
680
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
680
681
|
RestClient.stub(:delete).and_return(response)
|
681
682
|
|
682
683
|
result = @api.delete_promocode(1, 1)
|
@@ -689,7 +690,7 @@ describe ConstantContact::Api do
|
|
689
690
|
json = load_file('promocode_response.json')
|
690
691
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
691
692
|
|
692
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
693
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
693
694
|
RestClient.stub(:put).and_return(response)
|
694
695
|
promocode = ConstantContact::Components::Promocode.create(JSON.parse(json))
|
695
696
|
|
@@ -704,7 +705,7 @@ describe ConstantContact::Api do
|
|
704
705
|
json_response = load_file('email_campaigns_response.json')
|
705
706
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
706
707
|
|
707
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
708
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
708
709
|
RestClient.stub(:get).and_return(response)
|
709
710
|
|
710
711
|
campaigns = @api.get_email_campaigns({:limit => 2})
|
@@ -719,7 +720,7 @@ describe ConstantContact::Api do
|
|
719
720
|
json_response = load_file('email_campaign_response.json')
|
720
721
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
721
722
|
|
722
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
723
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
723
724
|
RestClient.stub(:get).and_return(response)
|
724
725
|
|
725
726
|
campaign = @api.get_email_campaign(1)
|
@@ -733,7 +734,7 @@ describe ConstantContact::Api do
|
|
733
734
|
json = load_file('email_campaign_response.json')
|
734
735
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
735
736
|
|
736
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
737
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
737
738
|
RestClient.stub(:post).and_return(response)
|
738
739
|
new_campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
739
740
|
|
@@ -748,7 +749,7 @@ describe ConstantContact::Api do
|
|
748
749
|
json = load_file('email_campaign_response.json')
|
749
750
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
750
751
|
|
751
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
752
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
752
753
|
RestClient.stub(:delete).and_return(response)
|
753
754
|
campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
754
755
|
|
@@ -762,7 +763,7 @@ describe ConstantContact::Api do
|
|
762
763
|
json = load_file('email_campaign_response.json')
|
763
764
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
764
765
|
|
765
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
766
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
766
767
|
RestClient.stub(:put).and_return(response)
|
767
768
|
campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
768
769
|
|
@@ -778,7 +779,7 @@ describe ConstantContact::Api do
|
|
778
779
|
json = load_file('schedule_response.json')
|
779
780
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
780
781
|
|
781
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
782
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
782
783
|
RestClient.stub(:post).and_return(response)
|
783
784
|
new_schedule = ConstantContact::Components::Schedule.create(JSON.parse(json))
|
784
785
|
|
@@ -794,7 +795,7 @@ describe ConstantContact::Api do
|
|
794
795
|
json = load_file('schedules_response.json')
|
795
796
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
796
797
|
|
797
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
798
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
798
799
|
RestClient.stub(:get).and_return(response)
|
799
800
|
|
800
801
|
schedules = @api.get_email_campaign_schedules(campaign_id)
|
@@ -811,7 +812,7 @@ describe ConstantContact::Api do
|
|
811
812
|
json = load_file('schedule_response.json')
|
812
813
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
813
814
|
|
814
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
815
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
815
816
|
RestClient.stub(:get).and_return(response)
|
816
817
|
|
817
818
|
schedule = @api.get_email_campaign_schedule(campaign_id, schedule_id)
|
@@ -826,7 +827,7 @@ describe ConstantContact::Api do
|
|
826
827
|
schedule_id = 1
|
827
828
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
828
829
|
|
829
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
830
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
830
831
|
RestClient.stub(:delete).and_return(response)
|
831
832
|
|
832
833
|
result = @api.delete_email_campaign_schedule(campaign_id, schedule_id)
|
@@ -840,7 +841,7 @@ describe ConstantContact::Api do
|
|
840
841
|
json = load_file('schedule_response.json')
|
841
842
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
842
843
|
|
843
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
844
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
844
845
|
RestClient.stub(:put).and_return(response)
|
845
846
|
schedule = ConstantContact::Components::Schedule.create(JSON.parse(json))
|
846
847
|
|
@@ -857,7 +858,7 @@ describe ConstantContact::Api do
|
|
857
858
|
json_response = load_file('test_send_response.json')
|
858
859
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
859
860
|
|
860
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
861
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
861
862
|
RestClient.stub(:post).and_return(response)
|
862
863
|
test_send = ConstantContact::Components::TestSend.create(JSON.parse(json_request))
|
863
864
|
|
@@ -874,7 +875,7 @@ describe ConstantContact::Api do
|
|
874
875
|
json = load_file('campaign_tracking_bounces_response.json')
|
875
876
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
876
877
|
|
877
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
878
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
878
879
|
RestClient.stub(:get).and_return(response)
|
879
880
|
|
880
881
|
set = @api.get_email_campaign_bounces(campaign_id, params)
|
@@ -891,7 +892,7 @@ describe ConstantContact::Api do
|
|
891
892
|
json = load_file('campaign_tracking_clicks_response.json')
|
892
893
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
893
894
|
|
894
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
895
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
895
896
|
RestClient.stub(:get).and_return(response)
|
896
897
|
|
897
898
|
set = @api.get_email_campaign_clicks(campaign_id, params)
|
@@ -908,7 +909,7 @@ describe ConstantContact::Api do
|
|
908
909
|
json = load_file('campaign_tracking_forwards_response.json')
|
909
910
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
910
911
|
|
911
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
912
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
912
913
|
RestClient.stub(:get).and_return(response)
|
913
914
|
|
914
915
|
set = @api.get_email_campaign_forwards(campaign_id, params)
|
@@ -925,7 +926,7 @@ describe ConstantContact::Api do
|
|
925
926
|
json = load_file('campaign_tracking_opens_response.json')
|
926
927
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
927
928
|
|
928
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
929
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
929
930
|
RestClient.stub(:get).and_return(response)
|
930
931
|
|
931
932
|
set = @api.get_email_campaign_opens(campaign_id, params)
|
@@ -942,7 +943,7 @@ describe ConstantContact::Api do
|
|
942
943
|
json = load_file('campaign_tracking_sends_response.json')
|
943
944
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
944
945
|
|
945
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
946
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
946
947
|
RestClient.stub(:get).and_return(response)
|
947
948
|
|
948
949
|
set = @api.get_email_campaign_sends(campaign_id, params)
|
@@ -959,7 +960,7 @@ describe ConstantContact::Api do
|
|
959
960
|
json = load_file('campaign_tracking_unsubscribes_response.json')
|
960
961
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
961
962
|
|
962
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
963
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
963
964
|
RestClient.stub(:get).and_return(response)
|
964
965
|
|
965
966
|
set = @api.get_email_campaign_unsubscribes(campaign_id, params)
|
@@ -975,7 +976,7 @@ describe ConstantContact::Api do
|
|
975
976
|
json = load_file('campaign_tracking_summary_response.json')
|
976
977
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
977
978
|
|
978
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
979
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
979
980
|
RestClient.stub(:get).and_return(response)
|
980
981
|
|
981
982
|
summary = @api.get_email_campaign_summary_report(campaign_id)
|
@@ -991,7 +992,7 @@ describe ConstantContact::Api do
|
|
991
992
|
json = load_file('contact_tracking_bounces_response.json')
|
992
993
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
993
994
|
|
994
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
995
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
995
996
|
RestClient.stub(:get).and_return(response)
|
996
997
|
|
997
998
|
set = @api.get_contact_bounces(contact_id, params)
|
@@ -1008,7 +1009,7 @@ describe ConstantContact::Api do
|
|
1008
1009
|
json = load_file('contact_tracking_clicks_response.json')
|
1009
1010
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1010
1011
|
|
1011
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1012
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1012
1013
|
RestClient.stub(:get).and_return(response)
|
1013
1014
|
|
1014
1015
|
set = @api.get_contact_clicks(contact_id, params)
|
@@ -1025,7 +1026,7 @@ describe ConstantContact::Api do
|
|
1025
1026
|
json = load_file('contact_tracking_forwards_response.json')
|
1026
1027
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1027
1028
|
|
1028
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1029
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1029
1030
|
RestClient.stub(:get).and_return(response)
|
1030
1031
|
|
1031
1032
|
set = @api.get_contact_forwards(contact_id, params)
|
@@ -1042,7 +1043,7 @@ describe ConstantContact::Api do
|
|
1042
1043
|
json = load_file('contact_tracking_opens_response.json')
|
1043
1044
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1044
1045
|
|
1045
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1046
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1046
1047
|
RestClient.stub(:get).and_return(response)
|
1047
1048
|
|
1048
1049
|
set = @api.get_contact_opens(contact_id, params)
|
@@ -1059,7 +1060,7 @@ describe ConstantContact::Api do
|
|
1059
1060
|
json = load_file('contact_tracking_sends_response.json')
|
1060
1061
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1061
1062
|
|
1062
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1063
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1063
1064
|
RestClient.stub(:get).and_return(response)
|
1064
1065
|
|
1065
1066
|
set = @api.get_contact_sends(contact_id, params)
|
@@ -1076,7 +1077,7 @@ describe ConstantContact::Api do
|
|
1076
1077
|
json = load_file('contact_tracking_unsubscribes_response.json')
|
1077
1078
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1078
1079
|
|
1079
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1080
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1080
1081
|
RestClient.stub(:get).and_return(response)
|
1081
1082
|
|
1082
1083
|
set = @api.get_contact_unsubscribes(contact_id, params)
|
@@ -1092,7 +1093,7 @@ describe ConstantContact::Api do
|
|
1092
1093
|
json = load_file('contact_tracking_summary_response.json')
|
1093
1094
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1094
1095
|
|
1095
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1096
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1096
1097
|
RestClient.stub(:get).and_return(response)
|
1097
1098
|
|
1098
1099
|
summary = @api.get_contact_summary_report(contact_id)
|
@@ -1106,7 +1107,7 @@ describe ConstantContact::Api do
|
|
1106
1107
|
json_response = load_file('activities_response.json')
|
1107
1108
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1108
1109
|
|
1109
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
1110
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
1110
1111
|
RestClient.stub(:get).and_return(response)
|
1111
1112
|
|
1112
1113
|
activities = @api.get_activities()
|
@@ -1120,7 +1121,7 @@ describe ConstantContact::Api do
|
|
1120
1121
|
json_response = load_file('activity_response.json')
|
1121
1122
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1122
1123
|
|
1123
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
1124
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
1124
1125
|
RestClient.stub(:get).and_return(response)
|
1125
1126
|
|
1126
1127
|
activity = @api.get_activity('a07e1ilbm7shdg6ikeo')
|
@@ -1136,7 +1137,7 @@ describe ConstantContact::Api do
|
|
1136
1137
|
json_contacts = load_file('contacts_response.json')
|
1137
1138
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1138
1139
|
|
1139
|
-
response = RestClient::Response.create(json_add_contacts, net_http_resp, {})
|
1140
|
+
response = RestClient::Response.create(json_add_contacts, net_http_resp, {}, @request)
|
1140
1141
|
RestClient.stub(:post).and_return(response)
|
1141
1142
|
|
1142
1143
|
import = ConstantContact::Components::AddContactsImportData.new
|
@@ -1182,7 +1183,7 @@ describe ConstantContact::Api do
|
|
1182
1183
|
lists = 'list1, list2'
|
1183
1184
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1184
1185
|
|
1185
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1186
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1186
1187
|
RestClient.stub(:post).and_return(response)
|
1187
1188
|
|
1188
1189
|
activity = @api.add_create_contacts_activity_from_file('contacts.txt', content, lists)
|
@@ -1201,7 +1202,7 @@ describe ConstantContact::Api do
|
|
1201
1202
|
|
1202
1203
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1203
1204
|
|
1204
|
-
response = RestClient::Response.create(json_clear_lists, net_http_resp, {})
|
1205
|
+
response = RestClient::Response.create(json_clear_lists, net_http_resp, {}, @request)
|
1205
1206
|
RestClient.stub(:post).and_return(response)
|
1206
1207
|
|
1207
1208
|
activity = @api.add_clear_lists_activity(lists)
|
@@ -1216,7 +1217,7 @@ describe ConstantContact::Api do
|
|
1216
1217
|
lists = 'list1, list2'
|
1217
1218
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1218
1219
|
|
1219
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1220
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1220
1221
|
RestClient.stub(:post).and_return(response)
|
1221
1222
|
email_addresses = ["djellesma@constantcontact.com"]
|
1222
1223
|
|
@@ -1234,7 +1235,7 @@ describe ConstantContact::Api do
|
|
1234
1235
|
lists = 'list1, list2'
|
1235
1236
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1236
1237
|
|
1237
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1238
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1238
1239
|
RestClient.stub(:post).and_return(response)
|
1239
1240
|
|
1240
1241
|
activity = @api.add_remove_contacts_from_lists_activity_from_file('contacts.txt', content, lists)
|
@@ -1249,7 +1250,7 @@ describe ConstantContact::Api do
|
|
1249
1250
|
json_response = load_file('export_contacts_response.json')
|
1250
1251
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1251
1252
|
|
1252
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
1253
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
1253
1254
|
RestClient.stub(:post).and_return(response)
|
1254
1255
|
export_contacts = ConstantContact::Components::ExportContacts.new(JSON.parse(json_request))
|
1255
1256
|
|
@@ -1264,7 +1265,7 @@ describe ConstantContact::Api do
|
|
1264
1265
|
json_response = load_file('library_info_response.json')
|
1265
1266
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1266
1267
|
|
1267
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
1268
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
1268
1269
|
RestClient.stub(:get).and_return(response)
|
1269
1270
|
|
1270
1271
|
info = @api.get_library_info()
|
@@ -1278,7 +1279,7 @@ describe ConstantContact::Api do
|
|
1278
1279
|
json_response = load_file('library_folders_response.json')
|
1279
1280
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1280
1281
|
|
1281
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
1282
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
1282
1283
|
RestClient.stub(:get).and_return(response)
|
1283
1284
|
|
1284
1285
|
folders = @api.get_library_folders({:limit => 2})
|
@@ -1293,7 +1294,7 @@ describe ConstantContact::Api do
|
|
1293
1294
|
json = load_file('library_folder_response.json')
|
1294
1295
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1295
1296
|
|
1296
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1297
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1297
1298
|
RestClient.stub(:post).and_return(response)
|
1298
1299
|
new_folder = ConstantContact::Components::LibraryFolder.create(JSON.parse(json))
|
1299
1300
|
|
@@ -1308,7 +1309,7 @@ describe ConstantContact::Api do
|
|
1308
1309
|
json = load_file('library_folder_response.json')
|
1309
1310
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1310
1311
|
|
1311
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1312
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1312
1313
|
RestClient.stub(:get).and_return(response)
|
1313
1314
|
|
1314
1315
|
folder = @api.get_library_folder(6)
|
@@ -1322,7 +1323,7 @@ describe ConstantContact::Api do
|
|
1322
1323
|
json = load_file('library_folder_response.json')
|
1323
1324
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1324
1325
|
|
1325
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1326
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1326
1327
|
RestClient.stub(:put).and_return(response)
|
1327
1328
|
folder = ConstantContact::Components::LibraryFolder.create(JSON.parse(json))
|
1328
1329
|
|
@@ -1337,7 +1338,7 @@ describe ConstantContact::Api do
|
|
1337
1338
|
folder_id = 6
|
1338
1339
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
1339
1340
|
|
1340
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
1341
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
1341
1342
|
RestClient.stub(:delete).and_return(response)
|
1342
1343
|
|
1343
1344
|
result = @api.delete_library_folder(folder_id)
|
@@ -1350,7 +1351,7 @@ describe ConstantContact::Api do
|
|
1350
1351
|
json = load_file('library_trash_response.json')
|
1351
1352
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1352
1353
|
|
1353
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1354
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1354
1355
|
RestClient.stub(:get).and_return(response)
|
1355
1356
|
|
1356
1357
|
files = @api.get_library_trash({:sort_by => 'SIZE_DESC'})
|
@@ -1364,7 +1365,7 @@ describe ConstantContact::Api do
|
|
1364
1365
|
it "permanently deletes all files in the Trash folder" do
|
1365
1366
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
1366
1367
|
|
1367
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
1368
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
1368
1369
|
RestClient.stub(:delete).and_return(response)
|
1369
1370
|
|
1370
1371
|
result = @api.delete_library_trash()
|
@@ -1377,7 +1378,7 @@ describe ConstantContact::Api do
|
|
1377
1378
|
json_response = load_file('library_files_response.json')
|
1378
1379
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1379
1380
|
|
1380
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
1381
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
1381
1382
|
RestClient.stub(:get).and_return(response)
|
1382
1383
|
|
1383
1384
|
files = @api.get_library_files({:type => 'ALL'})
|
@@ -1393,7 +1394,7 @@ describe ConstantContact::Api do
|
|
1393
1394
|
json_response = load_file('library_files_by_folder_response.json')
|
1394
1395
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1395
1396
|
|
1396
|
-
response = RestClient::Response.create(json_response, net_http_resp, {})
|
1397
|
+
response = RestClient::Response.create(json_response, net_http_resp, {}, @request)
|
1397
1398
|
RestClient.stub(:get).and_return(response)
|
1398
1399
|
|
1399
1400
|
files = @api.get_library_files_by_folder(folder_id, {:limit => 10})
|
@@ -1408,7 +1409,7 @@ describe ConstantContact::Api do
|
|
1408
1409
|
json = load_file('library_file_response.json')
|
1409
1410
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1410
1411
|
|
1411
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1412
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1412
1413
|
RestClient.stub(:get).and_return(response)
|
1413
1414
|
|
1414
1415
|
file = @api.get_library_file(6)
|
@@ -1428,7 +1429,7 @@ describe ConstantContact::Api do
|
|
1428
1429
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1429
1430
|
net_http_resp.add_field('Location', '"https://api.d1.constantcontact.com/v2/library/files/123456789')
|
1430
1431
|
|
1431
|
-
response = RestClient::Response.create("", net_http_resp, {})
|
1432
|
+
response = RestClient::Response.create("", net_http_resp, {}, @request)
|
1432
1433
|
RestClient.stub(:post).and_return(response)
|
1433
1434
|
|
1434
1435
|
response = @api.add_library_file(file_name, folder_id, description, source, file_type, contents)
|
@@ -1442,7 +1443,7 @@ describe ConstantContact::Api do
|
|
1442
1443
|
json = load_file('library_file_response.json')
|
1443
1444
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1444
1445
|
|
1445
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1446
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1446
1447
|
RestClient.stub(:put).and_return(response)
|
1447
1448
|
file = ConstantContact::Components::LibraryFile.create(JSON.parse(json))
|
1448
1449
|
|
@@ -1457,7 +1458,7 @@ describe ConstantContact::Api do
|
|
1457
1458
|
file_id = '6, 7'
|
1458
1459
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
1459
1460
|
|
1460
|
-
response = RestClient::Response.create('', net_http_resp, {})
|
1461
|
+
response = RestClient::Response.create('', net_http_resp, {}, @request)
|
1461
1462
|
RestClient.stub(:delete).and_return(response)
|
1462
1463
|
|
1463
1464
|
result = @api.delete_library_file(file_id)
|
@@ -1471,7 +1472,7 @@ describe ConstantContact::Api do
|
|
1471
1472
|
json = load_file('library_files_upload_status_response.json')
|
1472
1473
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1473
1474
|
|
1474
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1475
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1475
1476
|
RestClient.stub(:get).and_return(response)
|
1476
1477
|
|
1477
1478
|
statuses = @api.get_library_files_upload_status(file_id)
|
@@ -1488,7 +1489,7 @@ describe ConstantContact::Api do
|
|
1488
1489
|
json = load_file('library_files_move_results_response.json')
|
1489
1490
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
1490
1491
|
|
1491
|
-
response = RestClient::Response.create(json, net_http_resp, {})
|
1492
|
+
response = RestClient::Response.create(json, net_http_resp, {}, @request)
|
1492
1493
|
RestClient.stub(:put).and_return(response)
|
1493
1494
|
|
1494
1495
|
results = @api.move_library_files(folder_id, file_id)
|