constantcontact 1.3.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/constantcontact.gemspec +2 -2
- data/lib/constantcontact/api.rb +223 -307
- data/lib/constantcontact/services/account_service.rb +5 -7
- data/lib/constantcontact/services/activity_service.rb +16 -24
- data/lib/constantcontact/services/base_service.rb +3 -4
- data/lib/constantcontact/services/campaign_schedule_service.rb +12 -18
- data/lib/constantcontact/services/campaign_tracking_service.rb +14 -21
- data/lib/constantcontact/services/contact_service.rb +14 -21
- data/lib/constantcontact/services/contact_tracking_service.rb +14 -21
- data/lib/constantcontact/services/email_marketing_service.rb +10 -15
- data/lib/constantcontact/services/event_spot_service.rb +56 -85
- data/lib/constantcontact/services/library_service.rb +32 -48
- data/lib/constantcontact/services/list_service.rb +10 -15
- data/lib/constantcontact/util/config.rb +5 -3
- data/lib/constantcontact/version.rb +3 -3
- data/spec/constantcontact/api_spec.rb +121 -103
- data/spec/constantcontact/services/account_service_spec.rb +15 -1
- data/spec/constantcontact/services/activity_service_spec.rb +9 -14
- data/spec/constantcontact/services/base_service_spec.rb +2 -1
- data/spec/constantcontact/services/campaign_schedule_service_spec.rb +6 -6
- data/spec/constantcontact/services/campaign_tracking_service_spec.rb +7 -7
- data/spec/constantcontact/services/contact_service_spec.rb +7 -7
- data/spec/constantcontact/services/contact_tracking_service_spec.rb +7 -7
- data/spec/constantcontact/services/email_marketing_spec.rb +5 -5
- data/spec/constantcontact/services/event_spot_spec.rb +27 -27
- data/spec/constantcontact/services/library_service_spec.rb +16 -16
- data/spec/constantcontact/services/list_service_spec.rb +5 -5
- metadata +2 -2
@@ -15,7 +15,7 @@ describe ConstantContact::Services::LibraryService do
|
|
15
15
|
response = RestClient::Response.create(json_response, net_http_resp, {})
|
16
16
|
RestClient.stub(:get).and_return(response)
|
17
17
|
|
18
|
-
info = ConstantContact::Services::LibraryService.get_library_info(
|
18
|
+
info = ConstantContact::Services::LibraryService.get_library_info()
|
19
19
|
info.should be_kind_of(ConstantContact::Components::LibrarySummary)
|
20
20
|
info.usage_summary['folder_count'].should eq(6)
|
21
21
|
end
|
@@ -29,7 +29,7 @@ describe ConstantContact::Services::LibraryService do
|
|
29
29
|
response = RestClient::Response.create(json_response, net_http_resp, {})
|
30
30
|
RestClient.stub(:get).and_return(response)
|
31
31
|
|
32
|
-
folders = ConstantContact::Services::LibraryService.get_library_folders(
|
32
|
+
folders = ConstantContact::Services::LibraryService.get_library_folders({:limit => 2})
|
33
33
|
folders.should be_kind_of(ConstantContact::Components::ResultSet)
|
34
34
|
folders.results.first.should be_kind_of(ConstantContact::Components::LibraryFolder)
|
35
35
|
folders.results.first.name.should eq('backgrounds')
|
@@ -45,7 +45,7 @@ describe ConstantContact::Services::LibraryService do
|
|
45
45
|
RestClient.stub(:post).and_return(response)
|
46
46
|
new_folder = ConstantContact::Components::LibraryFolder.create(JSON.parse(json))
|
47
47
|
|
48
|
-
folder = ConstantContact::Services::LibraryService.add_library_folder(
|
48
|
+
folder = ConstantContact::Services::LibraryService.add_library_folder(new_folder)
|
49
49
|
folder.should be_kind_of(ConstantContact::Components::LibraryFolder)
|
50
50
|
folder.name.should eq('wildflowers')
|
51
51
|
end
|
@@ -59,7 +59,7 @@ describe ConstantContact::Services::LibraryService do
|
|
59
59
|
response = RestClient::Response.create(json, net_http_resp, {})
|
60
60
|
RestClient.stub(:get).and_return(response)
|
61
61
|
|
62
|
-
folder = ConstantContact::Services::LibraryService.get_library_folder(
|
62
|
+
folder = ConstantContact::Services::LibraryService.get_library_folder(6)
|
63
63
|
folder.should be_kind_of(ConstantContact::Components::LibraryFolder)
|
64
64
|
folder.name.should eq('wildflowers')
|
65
65
|
end
|
@@ -74,7 +74,7 @@ describe ConstantContact::Services::LibraryService do
|
|
74
74
|
RestClient.stub(:put).and_return(response)
|
75
75
|
folder = ConstantContact::Components::LibraryFolder.create(JSON.parse(json))
|
76
76
|
|
77
|
-
response = ConstantContact::Services::LibraryService.update_library_folder(
|
77
|
+
response = ConstantContact::Services::LibraryService.update_library_folder(folder)
|
78
78
|
response.should be_kind_of(ConstantContact::Components::LibraryFolder)
|
79
79
|
response.name.should eq('wildflowers')
|
80
80
|
end
|
@@ -88,7 +88,7 @@ describe ConstantContact::Services::LibraryService do
|
|
88
88
|
response = RestClient::Response.create('', net_http_resp, {})
|
89
89
|
RestClient.stub(:delete).and_return(response)
|
90
90
|
|
91
|
-
result = ConstantContact::Services::LibraryService.delete_library_folder(
|
91
|
+
result = ConstantContact::Services::LibraryService.delete_library_folder(folder_id)
|
92
92
|
result.should be_true
|
93
93
|
end
|
94
94
|
end
|
@@ -101,7 +101,7 @@ describe ConstantContact::Services::LibraryService do
|
|
101
101
|
response = RestClient::Response.create(json, net_http_resp, {})
|
102
102
|
RestClient.stub(:get).and_return(response)
|
103
103
|
|
104
|
-
files = ConstantContact::Services::LibraryService.get_library_trash(
|
104
|
+
files = ConstantContact::Services::LibraryService.get_library_trash({:sort_by => 'SIZE_DESC'})
|
105
105
|
files.should be_kind_of(ConstantContact::Components::ResultSet)
|
106
106
|
files.results.first.should be_kind_of(ConstantContact::Components::LibraryFile)
|
107
107
|
files.results.first.name.should eq('menu_form.pdf')
|
@@ -115,7 +115,7 @@ describe ConstantContact::Services::LibraryService do
|
|
115
115
|
response = RestClient::Response.create('', net_http_resp, {})
|
116
116
|
RestClient.stub(:delete).and_return(response)
|
117
117
|
|
118
|
-
result = ConstantContact::Services::LibraryService.delete_library_trash(
|
118
|
+
result = ConstantContact::Services::LibraryService.delete_library_trash()
|
119
119
|
result.should be_true
|
120
120
|
end
|
121
121
|
end
|
@@ -128,7 +128,7 @@ describe ConstantContact::Services::LibraryService do
|
|
128
128
|
response = RestClient::Response.create(json_response, net_http_resp, {})
|
129
129
|
RestClient.stub(:get).and_return(response)
|
130
130
|
|
131
|
-
files = ConstantContact::Services::LibraryService.get_library_files(
|
131
|
+
files = ConstantContact::Services::LibraryService.get_library_files({:type => 'ALL'})
|
132
132
|
files.should be_kind_of(ConstantContact::Components::ResultSet)
|
133
133
|
files.results.first.should be_kind_of(ConstantContact::Components::LibraryFile)
|
134
134
|
files.results.first.name.should eq('IMG_0341.JPG')
|
@@ -144,7 +144,7 @@ describe ConstantContact::Services::LibraryService do
|
|
144
144
|
response = RestClient::Response.create(json_response, net_http_resp, {})
|
145
145
|
RestClient.stub(:get).and_return(response)
|
146
146
|
|
147
|
-
files = ConstantContact::Services::LibraryService.get_library_files_by_folder(
|
147
|
+
files = ConstantContact::Services::LibraryService.get_library_files_by_folder(folder_id, {:limit => 10})
|
148
148
|
files.should be_kind_of(ConstantContact::Components::ResultSet)
|
149
149
|
files.results.first.should be_kind_of(ConstantContact::Components::LibraryFile)
|
150
150
|
files.results.first.name.should eq('IMG_0341.JPG')
|
@@ -159,7 +159,7 @@ describe ConstantContact::Services::LibraryService do
|
|
159
159
|
response = RestClient::Response.create(json, net_http_resp, {})
|
160
160
|
RestClient.stub(:get).and_return(response)
|
161
161
|
|
162
|
-
file = ConstantContact::Services::LibraryService.get_library_file(
|
162
|
+
file = ConstantContact::Services::LibraryService.get_library_file(6)
|
163
163
|
file.should be_kind_of(ConstantContact::Components::LibraryFile)
|
164
164
|
file.name.should eq('IMG_0261.JPG')
|
165
165
|
end
|
@@ -179,7 +179,7 @@ describe ConstantContact::Services::LibraryService do
|
|
179
179
|
response = RestClient::Response.create("", net_http_resp, {})
|
180
180
|
RestClient.stub(:post).and_return(response)
|
181
181
|
|
182
|
-
response = ConstantContact::Services::LibraryService.add_library_file(
|
182
|
+
response = ConstantContact::Services::LibraryService.add_library_file(file_name, folder_id, description, source, file_type, contents)
|
183
183
|
response.should be_kind_of(String)
|
184
184
|
response.should eq('123456789')
|
185
185
|
end
|
@@ -194,7 +194,7 @@ describe ConstantContact::Services::LibraryService do
|
|
194
194
|
RestClient.stub(:put).and_return(response)
|
195
195
|
file = ConstantContact::Components::LibraryFile.create(JSON.parse(json))
|
196
196
|
|
197
|
-
response = ConstantContact::Services::LibraryService.update_library_file(
|
197
|
+
response = ConstantContact::Services::LibraryService.update_library_file(file)
|
198
198
|
response.should be_kind_of(ConstantContact::Components::LibraryFile)
|
199
199
|
response.name.should eq('IMG_0261.JPG')
|
200
200
|
end
|
@@ -208,7 +208,7 @@ describe ConstantContact::Services::LibraryService do
|
|
208
208
|
response = RestClient::Response.create('', net_http_resp, {})
|
209
209
|
RestClient.stub(:delete).and_return(response)
|
210
210
|
|
211
|
-
result = ConstantContact::Services::LibraryService.delete_library_file(
|
211
|
+
result = ConstantContact::Services::LibraryService.delete_library_file(file_id)
|
212
212
|
result.should be_true
|
213
213
|
end
|
214
214
|
end
|
@@ -222,7 +222,7 @@ describe ConstantContact::Services::LibraryService do
|
|
222
222
|
response = RestClient::Response.create(json, net_http_resp, {})
|
223
223
|
RestClient.stub(:get).and_return(response)
|
224
224
|
|
225
|
-
statuses = ConstantContact::Services::LibraryService.get_library_files_upload_status(
|
225
|
+
statuses = ConstantContact::Services::LibraryService.get_library_files_upload_status(file_id)
|
226
226
|
statuses.should be_kind_of(Array)
|
227
227
|
statuses.first.should be_kind_of(ConstantContact::Components::UploadStatus)
|
228
228
|
statuses.first.status.should eq('Active')
|
@@ -239,7 +239,7 @@ describe ConstantContact::Services::LibraryService do
|
|
239
239
|
response = RestClient::Response.create(json, net_http_resp, {})
|
240
240
|
RestClient.stub(:put).and_return(response)
|
241
241
|
|
242
|
-
results = ConstantContact::Services::LibraryService.move_library_files(
|
242
|
+
results = ConstantContact::Services::LibraryService.move_library_files(folder_id, file_id)
|
243
243
|
results.should be_kind_of(Array)
|
244
244
|
results.first.should be_kind_of(ConstantContact::Components::MoveResults)
|
245
245
|
results.first.uri.should eq('https://api.d1.constantcontact.com/v2/library/files/9')
|
@@ -15,7 +15,7 @@ describe ConstantContact::Services::ListService do
|
|
15
15
|
response = RestClient::Response.create(json_response, net_http_resp, {})
|
16
16
|
RestClient.stub(:get).and_return(response)
|
17
17
|
|
18
|
-
lists = ConstantContact::Services::ListService.get_lists(
|
18
|
+
lists = ConstantContact::Services::ListService.get_lists()
|
19
19
|
lists.should be_kind_of(Array)
|
20
20
|
lists.first.should be_kind_of(ConstantContact::Components::ContactList)
|
21
21
|
lists.first.name.should eq('General Interest')
|
@@ -30,7 +30,7 @@ describe ConstantContact::Services::ListService do
|
|
30
30
|
response = RestClient::Response.create(json, net_http_resp, {})
|
31
31
|
RestClient.stub(:get).and_return(response)
|
32
32
|
|
33
|
-
list = ConstantContact::Services::ListService.get_list(
|
33
|
+
list = ConstantContact::Services::ListService.get_list(1)
|
34
34
|
list.should be_kind_of(ConstantContact::Components::ContactList)
|
35
35
|
list.name.should eq('Monthly Specials')
|
36
36
|
end
|
@@ -45,7 +45,7 @@ describe ConstantContact::Services::ListService do
|
|
45
45
|
RestClient.stub(:post).and_return(response)
|
46
46
|
new_list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
47
47
|
|
48
|
-
list = ConstantContact::Services::ListService.add_list(
|
48
|
+
list = ConstantContact::Services::ListService.add_list(new_list)
|
49
49
|
list.should be_kind_of(ConstantContact::Components::ContactList)
|
50
50
|
list.status.should eq('ACTIVE')
|
51
51
|
end
|
@@ -60,7 +60,7 @@ describe ConstantContact::Services::ListService do
|
|
60
60
|
RestClient.stub(:put).and_return(response)
|
61
61
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
62
62
|
|
63
|
-
result = ConstantContact::Services::ListService.update_list(
|
63
|
+
result = ConstantContact::Services::ListService.update_list(list)
|
64
64
|
result.should be_kind_of(ConstantContact::Components::ContactList)
|
65
65
|
result.status.should eq('ACTIVE')
|
66
66
|
end
|
@@ -76,7 +76,7 @@ describe ConstantContact::Services::ListService do
|
|
76
76
|
RestClient.stub(:get).and_return(response)
|
77
77
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json_list))
|
78
78
|
|
79
|
-
contacts = ConstantContact::Services::ListService.get_contacts_from_list(
|
79
|
+
contacts = ConstantContact::Services::ListService.get_contacts_from_list(list)
|
80
80
|
contacts.should be_kind_of(ConstantContact::Components::ResultSet)
|
81
81
|
contacts.results.first.should be_kind_of(ConstantContact::Components::Contact)
|
82
82
|
contacts.results.first.fax.should eq('318-978-7575')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constantcontact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ConstantContact
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|