constantcontact 3.0.0 → 4.0.0
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 +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
@@ -11,7 +11,7 @@ describe ConstantContact::SDK do
|
|
11
11
|
let(:dummy_class) { Class.new { include ConstantContact::SDK } }
|
12
12
|
|
13
13
|
it "should respond to VERSION" do
|
14
|
-
expect((dummy_class.const_get("VERSION") rescue nil)).to
|
14
|
+
expect((dummy_class.const_get("VERSION") rescue nil)).to be_truthy
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should have a VERSION of type string" do
|
@@ -17,7 +17,7 @@ describe ConstantContact::Services::AccountService do
|
|
17
17
|
json_response = load_file('account_info_response.json')
|
18
18
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
19
19
|
|
20
|
-
response =
|
20
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
21
21
|
RestClient.stub(:get).and_return(response)
|
22
22
|
|
23
23
|
result = ConstantContact::Services::AccountService.new(@client).get_account_info()
|
@@ -33,7 +33,7 @@ describe ConstantContact::Services::AccountService do
|
|
33
33
|
json_response = load_file('verified_email_addresses_response.json')
|
34
34
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
35
35
|
|
36
|
-
response =
|
36
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
37
37
|
RestClient.stub(:get).and_return(response)
|
38
38
|
|
39
39
|
params = {}
|
@@ -17,7 +17,7 @@ describe ConstantContact::Services::ActivityService do
|
|
17
17
|
json_response = load_file('activities_response.json')
|
18
18
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
19
19
|
|
20
|
-
response =
|
20
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
21
21
|
RestClient.stub(:get).and_return(response)
|
22
22
|
|
23
23
|
activities = ConstantContact::Services::ActivityService.new(@client).get_activities()
|
@@ -31,7 +31,7 @@ describe ConstantContact::Services::ActivityService do
|
|
31
31
|
json_response = load_file('activity_response.json')
|
32
32
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
33
33
|
|
34
|
-
response =
|
34
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
35
35
|
RestClient.stub(:get).and_return(response)
|
36
36
|
|
37
37
|
activity = ConstantContact::Services::ActivityService.new(@client).get_activity('a07e1ilbm7shdg6ikeo')
|
@@ -46,7 +46,7 @@ describe ConstantContact::Services::ActivityService do
|
|
46
46
|
json_response = load_file('add_contacts_response.json')
|
47
47
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
48
48
|
|
49
|
-
response =
|
49
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
50
50
|
RestClient.stub(:post).and_return(response)
|
51
51
|
|
52
52
|
contacts = []
|
@@ -137,7 +137,7 @@ describe ConstantContact::Services::ActivityService do
|
|
137
137
|
lists = 'list1, list2'
|
138
138
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
139
139
|
|
140
|
-
response = RestClient::Response.create(json, net_http_resp,
|
140
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
141
141
|
RestClient.stub(:post).and_return(response)
|
142
142
|
|
143
143
|
activity = ConstantContact::Services::ActivityService.new(@client).create_add_contacts_activity_from_file(
|
@@ -157,7 +157,7 @@ describe ConstantContact::Services::ActivityService do
|
|
157
157
|
|
158
158
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
159
159
|
|
160
|
-
response =
|
160
|
+
response =RestClient::Response.create(json_clear_lists, net_http_resp, @request)
|
161
161
|
RestClient.stub(:post).and_return(response)
|
162
162
|
|
163
163
|
activity = ConstantContact::Services::ActivityService.new(@client).add_clear_lists_activity(lists)
|
@@ -172,7 +172,7 @@ describe ConstantContact::Services::ActivityService do
|
|
172
172
|
lists = 'list1, list2'
|
173
173
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
174
174
|
|
175
|
-
response = RestClient::Response.create(json, net_http_resp,
|
175
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
176
176
|
RestClient.stub(:post).and_return(response)
|
177
177
|
email_addresses = ["djellesma@constantcontact.com"]
|
178
178
|
|
@@ -190,7 +190,7 @@ describe ConstantContact::Services::ActivityService do
|
|
190
190
|
lists = 'list1, list2'
|
191
191
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
192
192
|
|
193
|
-
response = RestClient::Response.create(json, net_http_resp,
|
193
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
194
194
|
RestClient.stub(:post).and_return(response)
|
195
195
|
|
196
196
|
activity = ConstantContact::Services::ActivityService.new(@client).add_remove_contacts_from_lists_activity_from_file(
|
@@ -206,7 +206,7 @@ describe ConstantContact::Services::ActivityService do
|
|
206
206
|
json_response = load_file('export_contacts_response.json')
|
207
207
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
208
208
|
|
209
|
-
response =
|
209
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
210
210
|
RestClient.stub(:post).and_return(response)
|
211
211
|
|
212
212
|
export_contacts = ConstantContact::Components::ExportContacts.new(JSON.parse(json_request))
|
@@ -223,7 +223,7 @@ describe ConstantContact::Services::ActivityService do
|
|
223
223
|
json_response = load_file('remove_contacts_from_lists_response.json')
|
224
224
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
225
225
|
|
226
|
-
response =
|
226
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
227
227
|
RestClient.stub(:post).and_return(response)
|
228
228
|
|
229
229
|
request_object = JSON.parse(json_request)
|
@@ -23,10 +23,10 @@ describe ConstantContact::Services::BaseService do
|
|
23
23
|
expect(headers[:authorization]).to be_a String
|
24
24
|
expect(headers[:authorization]).to eq("Bearer #{token}")
|
25
25
|
expect(headers[:user_agent]).to be_a String
|
26
|
-
expect(headers[:user_agent].include?("Ruby SDK v#{ConstantContact::SDK::VERSION}")).to
|
27
|
-
expect(headers[:user_agent].include?(RUBY_DESCRIPTION)).to
|
26
|
+
expect(headers[:user_agent].include?("Ruby SDK v#{ConstantContact::SDK::VERSION}")).to be_truthy
|
27
|
+
expect(headers[:user_agent].include?(RUBY_DESCRIPTION)).to be_truthy
|
28
28
|
expect(headers[:x_ctct_request_source]).to be_a String
|
29
|
-
expect(headers[:x_ctct_request_source].include?(ConstantContact::SDK::VERSION)).to
|
29
|
+
expect(headers[:x_ctct_request_source].include?(ConstantContact::SDK::VERSION)).to be_truthy
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -35,8 +35,8 @@ describe ConstantContact::Services::BaseService do
|
|
35
35
|
components = ConstantContact::Services::BaseService.new(@client).send(:build_url, "http://testing.com", :arg1 => 'abc', :arg2 => 123).split('&')
|
36
36
|
expect(components[0]).to eq('http://testing.com?api_key=api+key')
|
37
37
|
expect(components.length).to eq(3)
|
38
|
-
expect(components.include?('arg1=abc')).to
|
39
|
-
expect(components.include?('arg2=123')).to
|
38
|
+
expect(components.include?('arg1=abc')).to be_truthy
|
39
|
+
expect(components.include?('arg2=123')).to be_truthy
|
40
40
|
end
|
41
41
|
|
42
42
|
it "does not parse the next param when not in next_link format" do
|
@@ -18,7 +18,7 @@ describe ConstantContact::Services::CampaignScheduleService do
|
|
18
18
|
json = load_file('schedule_response.json')
|
19
19
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
20
20
|
|
21
|
-
response = RestClient::Response.create(json, net_http_resp,
|
21
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
22
22
|
RestClient.stub(:post).and_return(response)
|
23
23
|
new_schedule = ConstantContact::Components::Schedule.create(JSON.parse(json))
|
24
24
|
|
@@ -35,7 +35,7 @@ describe ConstantContact::Services::CampaignScheduleService do
|
|
35
35
|
json = load_file('schedules_response.json')
|
36
36
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
37
37
|
|
38
|
-
response = RestClient::Response.create(json, net_http_resp,
|
38
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
39
39
|
RestClient.stub(:get).and_return(response)
|
40
40
|
|
41
41
|
schedules = ConstantContact::Services::CampaignScheduleService.new(@client).get_schedules(
|
@@ -53,7 +53,7 @@ describe ConstantContact::Services::CampaignScheduleService do
|
|
53
53
|
json = load_file('schedule_response.json')
|
54
54
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
55
55
|
|
56
|
-
response = RestClient::Response.create(json, net_http_resp,
|
56
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
57
57
|
RestClient.stub(:get).and_return(response)
|
58
58
|
|
59
59
|
schedule = ConstantContact::Services::CampaignScheduleService.new(@client).get_schedule(
|
@@ -69,12 +69,12 @@ describe ConstantContact::Services::CampaignScheduleService do
|
|
69
69
|
schedule_id = 1
|
70
70
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
71
71
|
|
72
|
-
response = RestClient::Response.create('', net_http_resp,
|
72
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
73
73
|
RestClient.stub(:delete).and_return(response)
|
74
74
|
|
75
75
|
result = ConstantContact::Services::CampaignScheduleService.new(@client).delete_schedule(
|
76
76
|
campaign_id, schedule_id)
|
77
|
-
result.
|
77
|
+
expect(result).to eq true
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -84,7 +84,7 @@ describe ConstantContact::Services::CampaignScheduleService do
|
|
84
84
|
json = load_file('schedule_response.json')
|
85
85
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
86
86
|
|
87
|
-
response = RestClient::Response.create(json, net_http_resp,
|
87
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
88
88
|
RestClient.stub(:put).and_return(response)
|
89
89
|
schedule = ConstantContact::Components::Schedule.create(JSON.parse(json))
|
90
90
|
|
@@ -102,7 +102,7 @@ describe ConstantContact::Services::CampaignScheduleService do
|
|
102
102
|
json_response = load_file('test_send_response.json')
|
103
103
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
104
104
|
|
105
|
-
response =
|
105
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
106
106
|
RestClient.stub(:post).and_return(response)
|
107
107
|
test_send = ConstantContact::Components::TestSend.create(JSON.parse(json_request))
|
108
108
|
|
@@ -19,7 +19,7 @@ describe ConstantContact::Services::CampaignTrackingService do
|
|
19
19
|
json = load_file('campaign_tracking_bounces_response.json')
|
20
20
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
21
21
|
|
22
|
-
response = RestClient::Response.create(json, net_http_resp,
|
22
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
23
23
|
RestClient.stub(:get).and_return(response)
|
24
24
|
|
25
25
|
set = ConstantContact::Services::CampaignTrackingService.new(@client).get_bounces(campaign_id, params)
|
@@ -36,7 +36,7 @@ describe ConstantContact::Services::CampaignTrackingService do
|
|
36
36
|
json = load_file('campaign_tracking_clicks_response.json')
|
37
37
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
38
38
|
|
39
|
-
response = RestClient::Response.create(json, net_http_resp,
|
39
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
40
40
|
RestClient.stub(:get).and_return(response)
|
41
41
|
|
42
42
|
set = ConstantContact::Services::CampaignTrackingService.new(@client).get_clicks(campaign_id, params)
|
@@ -53,7 +53,7 @@ describe ConstantContact::Services::CampaignTrackingService do
|
|
53
53
|
json = load_file('campaign_tracking_forwards_response.json')
|
54
54
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
55
55
|
|
56
|
-
response = RestClient::Response.create(json, net_http_resp,
|
56
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
57
57
|
RestClient.stub(:get).and_return(response)
|
58
58
|
|
59
59
|
set = ConstantContact::Services::CampaignTrackingService.new(@client).get_forwards(campaign_id, params)
|
@@ -70,7 +70,7 @@ describe ConstantContact::Services::CampaignTrackingService do
|
|
70
70
|
json = load_file('campaign_tracking_opens_response.json')
|
71
71
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
72
72
|
|
73
|
-
response = RestClient::Response.create(json, net_http_resp,
|
73
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
74
74
|
RestClient.stub(:get).and_return(response)
|
75
75
|
|
76
76
|
set = ConstantContact::Services::CampaignTrackingService.new(@client).get_opens(campaign_id, params)
|
@@ -87,7 +87,7 @@ describe ConstantContact::Services::CampaignTrackingService do
|
|
87
87
|
json = load_file('campaign_tracking_sends_response.json')
|
88
88
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
89
89
|
|
90
|
-
response = RestClient::Response.create(json, net_http_resp,
|
90
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
91
91
|
RestClient.stub(:get).and_return(response)
|
92
92
|
|
93
93
|
set = ConstantContact::Services::CampaignTrackingService.new(@client).get_sends(campaign_id, params)
|
@@ -104,7 +104,7 @@ describe ConstantContact::Services::CampaignTrackingService do
|
|
104
104
|
json = load_file('campaign_tracking_unsubscribes_response.json')
|
105
105
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
106
106
|
|
107
|
-
response = RestClient::Response.create(json, net_http_resp,
|
107
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
108
108
|
RestClient.stub(:get).and_return(response)
|
109
109
|
|
110
110
|
set = ConstantContact::Services::CampaignTrackingService.new(@client).get_unsubscribes(campaign_id, params)
|
@@ -120,7 +120,7 @@ describe ConstantContact::Services::CampaignTrackingService do
|
|
120
120
|
json = load_file('campaign_tracking_summary_response.json')
|
121
121
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
122
122
|
|
123
|
-
response = RestClient::Response.create(json, net_http_resp,
|
123
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
124
124
|
RestClient.stub(:get).and_return(response)
|
125
125
|
|
126
126
|
summary = ConstantContact::Services::CampaignTrackingService.new(@client).get_summary(campaign_id)
|
@@ -17,7 +17,7 @@ describe ConstantContact::Services::ContactService do
|
|
17
17
|
json = load_file('contacts_response.json')
|
18
18
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
19
19
|
|
20
|
-
response = RestClient::Response.create(json, net_http_resp,
|
20
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
21
21
|
RestClient.stub(:get).and_return(response)
|
22
22
|
contacts = ConstantContact::Services::ContactService.new(@client).get_contacts()
|
23
23
|
contact = contacts.results[0]
|
@@ -32,7 +32,7 @@ describe ConstantContact::Services::ContactService do
|
|
32
32
|
json = load_file('contact_response.json')
|
33
33
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
34
34
|
|
35
|
-
response = RestClient::Response.create(json, net_http_resp,
|
35
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
36
36
|
RestClient.stub(:get).and_return(response)
|
37
37
|
contact = ConstantContact::Services::ContactService.new(@client).get_contact(1)
|
38
38
|
|
@@ -45,7 +45,7 @@ describe ConstantContact::Services::ContactService do
|
|
45
45
|
json = load_file('contact_response.json')
|
46
46
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
47
47
|
|
48
|
-
response = RestClient::Response.create(json, net_http_resp,
|
48
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
49
49
|
RestClient.stub(:post).and_return(response)
|
50
50
|
new_contact = ConstantContact::Components::Contact.create(JSON.parse(json))
|
51
51
|
contact = ConstantContact::Services::ContactService.new(@client).add_contact(new_contact)
|
@@ -60,11 +60,11 @@ describe ConstantContact::Services::ContactService do
|
|
60
60
|
contact_id = 196
|
61
61
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
62
62
|
|
63
|
-
response = RestClient::Response.create('', net_http_resp,
|
63
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
64
64
|
RestClient.stub(:delete).and_return(response)
|
65
65
|
|
66
66
|
result = ConstantContact::Services::ContactService.new(@client).delete_contact(contact_id)
|
67
|
-
result.
|
67
|
+
expect(result).to eq true
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
@@ -73,11 +73,11 @@ describe ConstantContact::Services::ContactService do
|
|
73
73
|
contact_id = 196
|
74
74
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
75
75
|
|
76
|
-
response = RestClient::Response.create('', net_http_resp,
|
76
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
77
77
|
RestClient.stub(:delete).and_return(response)
|
78
78
|
|
79
79
|
result = ConstantContact::Services::ContactService.new(@client).delete_contact_from_lists(contact_id)
|
80
|
-
result.
|
80
|
+
expect(result).to eq true
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -87,11 +87,11 @@ describe ConstantContact::Services::ContactService do
|
|
87
87
|
list_id = 1
|
88
88
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
89
89
|
|
90
|
-
response = RestClient::Response.create('', net_http_resp,
|
90
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
91
91
|
RestClient.stub(:delete).and_return(response)
|
92
92
|
|
93
93
|
result = ConstantContact::Services::ContactService.new(@client).delete_contact_from_list(contact_id, list_id)
|
94
|
-
result.
|
94
|
+
expect(result).to eq true
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -100,7 +100,7 @@ describe ConstantContact::Services::ContactService do
|
|
100
100
|
json = load_file('contact_response.json')
|
101
101
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
102
102
|
|
103
|
-
response = RestClient::Response.create(json, net_http_resp,
|
103
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
104
104
|
RestClient.stub(:put).and_return(response)
|
105
105
|
contact = ConstantContact::Components::Contact.create(JSON.parse(json))
|
106
106
|
result = ConstantContact::Services::ContactService.new(@client).update_contact(contact)
|
@@ -19,7 +19,7 @@ describe ConstantContact::Services::ContactTrackingService do
|
|
19
19
|
json = load_file('contact_tracking_bounces_response.json')
|
20
20
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
21
21
|
|
22
|
-
response = RestClient::Response.create(json, net_http_resp,
|
22
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
23
23
|
RestClient.stub(:get).and_return(response)
|
24
24
|
|
25
25
|
set = ConstantContact::Services::ContactTrackingService.new(@client).get_bounces(contact_id, params)
|
@@ -36,7 +36,7 @@ describe ConstantContact::Services::ContactTrackingService do
|
|
36
36
|
json = load_file('contact_tracking_clicks_response.json')
|
37
37
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
38
38
|
|
39
|
-
response = RestClient::Response.create(json, net_http_resp,
|
39
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
40
40
|
RestClient.stub(:get).and_return(response)
|
41
41
|
|
42
42
|
set = ConstantContact::Services::ContactTrackingService.new(@client).get_clicks(contact_id, params)
|
@@ -53,7 +53,7 @@ describe ConstantContact::Services::ContactTrackingService do
|
|
53
53
|
json = load_file('contact_tracking_forwards_response.json')
|
54
54
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
55
55
|
|
56
|
-
response = RestClient::Response.create(json, net_http_resp,
|
56
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
57
57
|
RestClient.stub(:get).and_return(response)
|
58
58
|
|
59
59
|
set = ConstantContact::Services::ContactTrackingService.new(@client).get_forwards(contact_id, params)
|
@@ -70,7 +70,7 @@ describe ConstantContact::Services::ContactTrackingService do
|
|
70
70
|
json = load_file('contact_tracking_opens_response.json')
|
71
71
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
72
72
|
|
73
|
-
response = RestClient::Response.create(json, net_http_resp,
|
73
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
74
74
|
RestClient.stub(:get).and_return(response)
|
75
75
|
|
76
76
|
set = ConstantContact::Services::ContactTrackingService.new(@client).get_opens(contact_id, params)
|
@@ -87,7 +87,7 @@ describe ConstantContact::Services::ContactTrackingService do
|
|
87
87
|
json = load_file('contact_tracking_sends_response.json')
|
88
88
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
89
89
|
|
90
|
-
response = RestClient::Response.create(json, net_http_resp,
|
90
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
91
91
|
RestClient.stub(:get).and_return(response)
|
92
92
|
|
93
93
|
set = ConstantContact::Services::ContactTrackingService.new(@client).get_sends(contact_id, params)
|
@@ -104,7 +104,7 @@ describe ConstantContact::Services::ContactTrackingService do
|
|
104
104
|
json = load_file('contact_tracking_unsubscribes_response.json')
|
105
105
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
106
106
|
|
107
|
-
response = RestClient::Response.create(json, net_http_resp,
|
107
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
108
108
|
RestClient.stub(:get).and_return(response)
|
109
109
|
|
110
110
|
set = ConstantContact::Services::ContactTrackingService.new(@client).get_unsubscribes(contact_id, params)
|
@@ -120,7 +120,7 @@ describe ConstantContact::Services::ContactTrackingService do
|
|
120
120
|
json = load_file('contact_tracking_summary_response.json')
|
121
121
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
122
122
|
|
123
|
-
response = RestClient::Response.create(json, net_http_resp,
|
123
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
124
124
|
RestClient.stub(:get).and_return(response)
|
125
125
|
|
126
126
|
summary = ConstantContact::Services::CampaignTrackingService.new(@client).get_summary(contact_id)
|
@@ -17,7 +17,7 @@ describe ConstantContact::Services::EmailMarketingService do
|
|
17
17
|
json_response = load_file('email_campaigns_response.json')
|
18
18
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
19
19
|
|
20
|
-
response =
|
20
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
21
21
|
RestClient.stub(:get).and_return(response)
|
22
22
|
|
23
23
|
campaigns = ConstantContact::Services::EmailMarketingService.new(@client).get_campaigns()
|
@@ -32,7 +32,7 @@ describe ConstantContact::Services::EmailMarketingService do
|
|
32
32
|
json_response = load_file('email_campaign_response.json')
|
33
33
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
34
34
|
|
35
|
-
response =
|
35
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
36
36
|
RestClient.stub(:get).and_return(response)
|
37
37
|
|
38
38
|
campaign = ConstantContact::Services::EmailMarketingService.new(@client).get_campaign(1)
|
@@ -46,7 +46,7 @@ describe ConstantContact::Services::EmailMarketingService do
|
|
46
46
|
json_response = load_file('email_campaign_preview_response.json')
|
47
47
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
48
48
|
|
49
|
-
response =
|
49
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
50
50
|
RestClient.stub(:get).and_return(response)
|
51
51
|
|
52
52
|
campaign_preview = ConstantContact::Services::EmailMarketingService.new(@client).get_campaign_preview(1)
|
@@ -60,7 +60,7 @@ describe ConstantContact::Services::EmailMarketingService do
|
|
60
60
|
json = load_file('email_campaign_response.json')
|
61
61
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
62
62
|
|
63
|
-
response = RestClient::Response.create(json, net_http_resp,
|
63
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
64
64
|
RestClient.stub(:post).and_return(response)
|
65
65
|
new_campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
66
66
|
|
@@ -75,12 +75,12 @@ describe ConstantContact::Services::EmailMarketingService do
|
|
75
75
|
json = load_file('email_campaign_response.json')
|
76
76
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
77
77
|
|
78
|
-
response = RestClient::Response.create('', net_http_resp,
|
78
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
79
79
|
RestClient.stub(:delete).and_return(response)
|
80
80
|
campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
81
81
|
|
82
82
|
result = ConstantContact::Services::EmailMarketingService.new(@client).delete_campaign(campaign)
|
83
|
-
result.
|
83
|
+
expect(result).to eq true
|
84
84
|
end
|
85
85
|
end
|
86
86
|
|
@@ -89,7 +89,7 @@ describe ConstantContact::Services::EmailMarketingService do
|
|
89
89
|
json = load_file('email_campaign_response.json')
|
90
90
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
91
91
|
|
92
|
-
response = RestClient::Response.create(json, net_http_resp,
|
92
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
93
93
|
RestClient.stub(:put).and_return(response)
|
94
94
|
campaign = ConstantContact::Components::Campaign.create(JSON.parse(json))
|
95
95
|
|
@@ -17,7 +17,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
17
17
|
json = load_file('events.json')
|
18
18
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
19
19
|
|
20
|
-
response = RestClient::Response.create(json, net_http_resp,
|
20
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
21
21
|
RestClient.stub(:get).and_return(response)
|
22
22
|
events = ConstantContact::Services::EventSpotService.new(@client).get_events()
|
23
23
|
events.should be_kind_of(ConstantContact::Components::ResultSet)
|
@@ -30,7 +30,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
30
30
|
json = load_file('event.json')
|
31
31
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
32
32
|
|
33
|
-
response = RestClient::Response.create(json, net_http_resp,
|
33
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
34
34
|
RestClient.stub(:get).and_return(response)
|
35
35
|
event = ConstantContact::Services::EventSpotService.new(@client).get_event(1)
|
36
36
|
|
@@ -43,7 +43,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
43
43
|
json = load_file('event.json')
|
44
44
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
45
45
|
|
46
|
-
response = RestClient::Response.create(json, net_http_resp,
|
46
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
47
47
|
RestClient.stub(:post).and_return(response)
|
48
48
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
49
49
|
added = ConstantContact::Services::EventSpotService.new(@client).add_event(event)
|
@@ -60,7 +60,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
60
60
|
hash["status"] = "ACTIVE"
|
61
61
|
|
62
62
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
63
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp,
|
63
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, @request)
|
64
64
|
RestClient.stub(:patch).and_return(response)
|
65
65
|
|
66
66
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -78,7 +78,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
78
78
|
hash["status"] = "CANCELLED"
|
79
79
|
|
80
80
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
81
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp,
|
81
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, @request)
|
82
82
|
RestClient.stub(:patch).and_return(response)
|
83
83
|
|
84
84
|
event = ConstantContact::Components::Event.create(JSON.parse(json))
|
@@ -95,7 +95,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
95
95
|
fees_json = load_file('fees.json')
|
96
96
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
97
97
|
|
98
|
-
response =
|
98
|
+
response =RestClient::Response.create(fees_json, net_http_resp, @request)
|
99
99
|
RestClient.stub(:get).and_return(response)
|
100
100
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
101
101
|
fees = ConstantContact::Services::EventSpotService.new(@client).get_fees(event)
|
@@ -113,7 +113,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
113
113
|
fee_json = load_file('fees.json')
|
114
114
|
|
115
115
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
116
|
-
response =
|
116
|
+
response =RestClient::Response.create(fee_json, net_http_resp, @request)
|
117
117
|
RestClient.stub(:get).and_return(response)
|
118
118
|
|
119
119
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -129,7 +129,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
129
129
|
fee_json = load_file('fee.json')
|
130
130
|
|
131
131
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
132
|
-
response =
|
132
|
+
response =RestClient::Response.create(fee_json, net_http_resp, @request)
|
133
133
|
RestClient.stub(:post).and_return(response)
|
134
134
|
|
135
135
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -148,7 +148,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
148
148
|
hash['fee'] += 1
|
149
149
|
|
150
150
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
151
|
-
response = RestClient::Response.create(hash.to_json, net_http_resp,
|
151
|
+
response = RestClient::Response.create(hash.to_json, net_http_resp, @request)
|
152
152
|
RestClient.stub(:put).and_return(response)
|
153
153
|
|
154
154
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -166,12 +166,12 @@ describe ConstantContact::Services::EventSpotService do
|
|
166
166
|
fee_json = load_file('fees.json')
|
167
167
|
|
168
168
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
169
|
-
response = RestClient::Response.create('', net_http_resp,
|
169
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
170
170
|
RestClient.stub(:delete).and_return(response)
|
171
171
|
|
172
172
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
173
173
|
fee = ConstantContact::Components::EventFee.create(JSON.parse(fee_json))
|
174
|
-
ConstantContact::Services::EventSpotService.new(@client).delete_fee(event, fee).
|
174
|
+
expect(ConstantContact::Services::EventSpotService.new(@client).delete_fee(event, fee)).to eq true
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -181,7 +181,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
181
181
|
registrants_json = load_file('registrants.json')
|
182
182
|
|
183
183
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
184
|
-
response =
|
184
|
+
response =RestClient::Response.create(registrants_json, net_http_resp, @request)
|
185
185
|
RestClient.stub(:get).and_return(response)
|
186
186
|
|
187
187
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -197,7 +197,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
197
197
|
registrant_json = load_file('registrant.json')
|
198
198
|
|
199
199
|
net_http_resp = Net::HTTPResponse.new(1.0, 201, 'Created')
|
200
|
-
response =
|
200
|
+
response =RestClient::Response.create(registrant_json, net_http_resp, @request)
|
201
201
|
RestClient.stub(:get).and_return(response)
|
202
202
|
|
203
203
|
event = ConstantContact::Components::Event.create(JSON.parse(event_json))
|
@@ -213,7 +213,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
213
213
|
json_response = load_file('event_items_response.json')
|
214
214
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
215
215
|
|
216
|
-
response =
|
216
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
217
217
|
RestClient.stub(:get).and_return(response)
|
218
218
|
|
219
219
|
results = ConstantContact::Services::EventSpotService.new(@client).get_event_items(1)
|
@@ -228,7 +228,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
228
228
|
json = load_file('event_item_response.json')
|
229
229
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
230
230
|
|
231
|
-
response = RestClient::Response.create(json, net_http_resp,
|
231
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
232
232
|
RestClient.stub(:get).and_return(response)
|
233
233
|
|
234
234
|
result = ConstantContact::Services::EventSpotService.new(@client).get_event_item(1, 1)
|
@@ -242,7 +242,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
242
242
|
json = load_file('event_item_response.json')
|
243
243
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
244
244
|
|
245
|
-
response = RestClient::Response.create(json, net_http_resp,
|
245
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
246
246
|
RestClient.stub(:post).and_return(response)
|
247
247
|
event_item = ConstantContact::Components::EventItem.create(JSON.parse(json))
|
248
248
|
|
@@ -256,11 +256,11 @@ describe ConstantContact::Services::EventSpotService do
|
|
256
256
|
it "deletes an event item" do
|
257
257
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
258
258
|
|
259
|
-
response = RestClient::Response.create('', net_http_resp,
|
259
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
260
260
|
RestClient.stub(:delete).and_return(response)
|
261
261
|
|
262
262
|
result = ConstantContact::Services::EventSpotService.new(@client).delete_event_item(1, 1)
|
263
|
-
result.
|
263
|
+
expect(result).to eq true
|
264
264
|
end
|
265
265
|
end
|
266
266
|
|
@@ -269,7 +269,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
269
269
|
json = load_file('event_item_response.json')
|
270
270
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
271
271
|
|
272
|
-
response = RestClient::Response.create(json, net_http_resp,
|
272
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
273
273
|
RestClient.stub(:put).and_return(response)
|
274
274
|
event_item = ConstantContact::Components::EventItem.create(JSON.parse(json))
|
275
275
|
|
@@ -284,7 +284,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
284
284
|
json_response = load_file('event_item_attributes_response.json')
|
285
285
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
286
286
|
|
287
|
-
response =
|
287
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
288
288
|
RestClient.stub(:get).and_return(response)
|
289
289
|
|
290
290
|
results = ConstantContact::Services::EventSpotService.new(@client).get_event_item_attributes(1, 1)
|
@@ -299,7 +299,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
299
299
|
json = load_file('event_item_attribute_response.json')
|
300
300
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
301
301
|
|
302
|
-
response = RestClient::Response.create(json, net_http_resp,
|
302
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
303
303
|
RestClient.stub(:get).and_return(response)
|
304
304
|
|
305
305
|
result = ConstantContact::Services::EventSpotService.new(@client).get_event_item_attribute(1, 1, 1)
|
@@ -313,7 +313,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
313
313
|
json = load_file('event_item_attribute_response.json')
|
314
314
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
315
315
|
|
316
|
-
response = RestClient::Response.create(json, net_http_resp,
|
316
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
317
317
|
RestClient.stub(:post).and_return(response)
|
318
318
|
event_item_attribute = ConstantContact::Components::EventItemAttribute.create(JSON.parse(json))
|
319
319
|
|
@@ -327,11 +327,11 @@ describe ConstantContact::Services::EventSpotService do
|
|
327
327
|
it "deletes an event item attribute" do
|
328
328
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
329
329
|
|
330
|
-
response = RestClient::Response.create('', net_http_resp,
|
330
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
331
331
|
RestClient.stub(:delete).and_return(response)
|
332
332
|
|
333
333
|
result = ConstantContact::Services::EventSpotService.new(@client).delete_event_item_attribute(1, 1, 1)
|
334
|
-
result.
|
334
|
+
expect(result).to eq true
|
335
335
|
end
|
336
336
|
end
|
337
337
|
|
@@ -340,7 +340,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
340
340
|
json = load_file('event_item_attribute_response.json')
|
341
341
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
342
342
|
|
343
|
-
response = RestClient::Response.create(json, net_http_resp,
|
343
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
344
344
|
RestClient.stub(:put).and_return(response)
|
345
345
|
event_item_attribute = ConstantContact::Components::EventItemAttribute.create(JSON.parse(json))
|
346
346
|
|
@@ -355,7 +355,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
355
355
|
json_response = load_file('promocodes_response.json')
|
356
356
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
357
357
|
|
358
|
-
response =
|
358
|
+
response =RestClient::Response.create(json_response, net_http_resp, @request)
|
359
359
|
RestClient.stub(:get).and_return(response)
|
360
360
|
|
361
361
|
results = ConstantContact::Services::EventSpotService.new(@client).get_promocodes(1)
|
@@ -370,7 +370,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
370
370
|
json = load_file('promocode_response.json')
|
371
371
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
372
372
|
|
373
|
-
response = RestClient::Response.create(json, net_http_resp,
|
373
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
374
374
|
RestClient.stub(:get).and_return(response)
|
375
375
|
|
376
376
|
result = ConstantContact::Services::EventSpotService.new(@client).get_promocode(1, 1)
|
@@ -384,7 +384,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
384
384
|
json = load_file('promocode_response.json')
|
385
385
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
386
386
|
|
387
|
-
response = RestClient::Response.create(json, net_http_resp,
|
387
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
388
388
|
RestClient.stub(:post).and_return(response)
|
389
389
|
promocode = ConstantContact::Components::Promocode.create(JSON.parse(json))
|
390
390
|
|
@@ -398,11 +398,11 @@ describe ConstantContact::Services::EventSpotService do
|
|
398
398
|
it "deletes a promocode" do
|
399
399
|
net_http_resp = Net::HTTPResponse.new(1.0, 204, 'No Content')
|
400
400
|
|
401
|
-
response = RestClient::Response.create('', net_http_resp,
|
401
|
+
response = RestClient::Response.create('', net_http_resp, @request)
|
402
402
|
RestClient.stub(:delete).and_return(response)
|
403
403
|
|
404
404
|
result = ConstantContact::Services::EventSpotService.new(@client).delete_promocode(1, 1)
|
405
|
-
result.
|
405
|
+
expect(result).to eq true
|
406
406
|
end
|
407
407
|
end
|
408
408
|
|
@@ -411,7 +411,7 @@ describe ConstantContact::Services::EventSpotService do
|
|
411
411
|
json = load_file('promocode_response.json')
|
412
412
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
413
413
|
|
414
|
-
response = RestClient::Response.create(json, net_http_resp,
|
414
|
+
response = RestClient::Response.create(json, net_http_resp, @request)
|
415
415
|
RestClient.stub(:put).and_return(response)
|
416
416
|
promocode = ConstantContact::Components::Promocode.create(JSON.parse(json))
|
417
417
|
|