constantcontact 1.0.2 → 1.1.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 +127 -136
- data/constantcontact.gemspec +4 -3
- data/lib/constantcontact.rb +63 -44
- data/lib/constantcontact/api.rb +932 -535
- data/lib/constantcontact/auth/oauth2.rb +86 -66
- data/lib/constantcontact/components/account/verified_email_address.rb +14 -14
- data/lib/constantcontact/components/activities/activity.rb +30 -30
- data/lib/constantcontact/components/activities/activity_error.rb +14 -14
- data/lib/constantcontact/components/activities/add_contacts.rb +1 -1
- data/lib/constantcontact/components/activities/add_contacts_import_data.rb +37 -36
- data/lib/constantcontact/components/component.rb +25 -0
- data/lib/constantcontact/components/contacts/address.rb +12 -12
- data/lib/constantcontact/components/contacts/contact.rb +50 -44
- data/lib/constantcontact/components/contacts/contact_list.rb +12 -12
- data/lib/constantcontact/components/contacts/custom_field.rb +14 -14
- data/lib/constantcontact/components/contacts/email_address.rb +14 -14
- data/lib/constantcontact/components/contacts/note.rb +13 -13
- data/lib/constantcontact/components/email_marketing/campaign.rb +41 -41
- data/lib/constantcontact/components/email_marketing/click_through_details.rb +14 -14
- data/lib/constantcontact/components/email_marketing/message_footer.rb +14 -14
- data/lib/constantcontact/components/email_marketing/schedule.rb +14 -15
- data/lib/constantcontact/components/email_marketing/test_send.rb +21 -21
- data/lib/constantcontact/components/event_spot/contact.rb +27 -0
- data/lib/constantcontact/components/event_spot/event.rb +63 -0
- data/lib/constantcontact/components/event_spot/event_track.rb +28 -0
- data/lib/constantcontact/components/event_spot/fee.rb +27 -0
- data/lib/constantcontact/components/event_spot/guest.rb +31 -0
- data/lib/constantcontact/components/event_spot/notification_option.rb +27 -0
- data/lib/constantcontact/components/event_spot/promo_code.rb +26 -0
- data/lib/constantcontact/components/event_spot/registrant.rb +54 -0
- data/lib/constantcontact/components/event_spot/registrant_field.rb +27 -0
- data/lib/constantcontact/components/event_spot/registrant_section.rb +34 -0
- data/lib/constantcontact/components/event_spot/sale_item.rb +27 -0
- data/lib/constantcontact/components/library/file/library_file.rb +27 -0
- data/lib/constantcontact/components/library/folder/library_folder.rb +26 -0
- data/lib/constantcontact/components/library/info/library_summary.rb +26 -0
- data/lib/constantcontact/components/library/info/move_results.rb +26 -0
- data/lib/constantcontact/components/library/info/upload_status.rb +26 -0
- data/lib/constantcontact/components/tracking/bounce_activity.rb +14 -14
- data/lib/constantcontact/components/tracking/click_activity.rb +14 -14
- data/lib/constantcontact/components/tracking/forward_activity.rb +14 -14
- data/lib/constantcontact/components/tracking/open_activity.rb +14 -14
- data/lib/constantcontact/components/tracking/send_activity.rb +14 -14
- data/lib/constantcontact/components/tracking/tracking_summary.rb +17 -17
- data/lib/constantcontact/components/tracking/unsubscribe_activity.rb +14 -14
- data/lib/constantcontact/services/account_service.rb +4 -3
- data/lib/constantcontact/services/activity_service.rb +40 -3
- data/lib/constantcontact/services/base_service.rb +34 -6
- data/lib/constantcontact/services/campaign_tracking_service.rb +20 -20
- data/lib/constantcontact/services/contact_service.rb +10 -12
- data/lib/constantcontact/services/contact_tracking_service.rb +20 -20
- data/lib/constantcontact/services/email_marketing_service.rb +8 -10
- data/lib/constantcontact/services/event_spot_service.rb +254 -0
- data/lib/constantcontact/services/library_service.rb +297 -0
- data/lib/constantcontact/services/list_service.rb +6 -5
- data/lib/constantcontact/util/config.rb +135 -117
- data/lib/constantcontact/version.rb +1 -1
- data/spec/constantcontact/api_spec.rb +1223 -173
- data/spec/constantcontact/auth/oauth2_spec.rb +60 -47
- data/spec/constantcontact/components/contacts/address_spec.rb +1 -1
- data/spec/constantcontact/components/contacts/contact_list_spec.rb +1 -1
- data/spec/constantcontact/components/contacts/contact_spec.rb +1 -1
- data/spec/constantcontact/components/contacts/email_address_spec.rb +1 -1
- data/spec/constantcontact/services/activity_service_spec.rb +201 -0
- data/spec/constantcontact/services/base_service_spec.rb +27 -0
- data/spec/constantcontact/services/campaign_schedule_service_spec.rb +111 -0
- data/spec/constantcontact/services/campaign_tracking_service_spec.rb +127 -0
- data/spec/constantcontact/services/contact_service_spec.rb +24 -22
- data/spec/constantcontact/services/contact_tracking_service_spec.rb +127 -0
- data/spec/constantcontact/services/email_marketing_spec.rb +72 -66
- data/spec/constantcontact/services/event_spot_spec.rb +217 -0
- data/spec/constantcontact/services/library_service_spec.rb +248 -0
- data/spec/constantcontact/services/list_service_spec.rb +33 -17
- data/spec/spec_helper.rb +3 -1
- metadata +63 -7
@@ -9,61 +9,77 @@ require 'spec_helper'
|
|
9
9
|
describe ConstantContact::Services::ListService do
|
10
10
|
describe "#get_lists" do
|
11
11
|
it "returns an array of lists" do
|
12
|
-
|
12
|
+
json_response = load_file('lists_response.json')
|
13
13
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
14
14
|
|
15
|
-
response = RestClient::Response.create(
|
15
|
+
response = RestClient::Response.create(json_response, net_http_resp, {})
|
16
16
|
RestClient.stub(:get).and_return(response)
|
17
|
-
lists = ConstantContact::Services::ListService.get_lists('token')
|
18
|
-
list = lists[0]
|
19
17
|
|
18
|
+
lists = ConstantContact::Services::ListService.get_lists('token')
|
20
19
|
lists.should be_kind_of(Array)
|
21
|
-
|
20
|
+
lists.first.should be_kind_of(ConstantContact::Components::ContactList)
|
21
|
+
lists.first.name.should eq('General Interest')
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "#get_list" do
|
26
26
|
it "returns a list" do
|
27
|
-
json =
|
27
|
+
json = load_file('list_response.json')
|
28
28
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
29
29
|
|
30
30
|
response = RestClient::Response.create(json, net_http_resp, {})
|
31
31
|
RestClient.stub(:get).and_return(response)
|
32
|
-
contact = ConstantContact::Services::ListService.get_list('token', 1)
|
33
32
|
|
34
|
-
|
33
|
+
list = ConstantContact::Services::ListService.get_list('token', 1)
|
34
|
+
list.should be_kind_of(ConstantContact::Components::ContactList)
|
35
|
+
list.name.should eq('Monthly Specials')
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
38
39
|
describe "#add_list" do
|
39
40
|
it "adds a list" do
|
40
|
-
json =
|
41
|
+
json = load_file('list_response.json')
|
41
42
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
42
43
|
|
43
44
|
response = RestClient::Response.create(json, net_http_resp, {})
|
44
45
|
RestClient.stub(:post).and_return(response)
|
46
|
+
new_list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
47
|
+
|
48
|
+
list = ConstantContact::Services::ListService.add_list('token', new_list)
|
49
|
+
list.should be_kind_of(ConstantContact::Components::ContactList)
|
50
|
+
list.status.should eq('ACTIVE')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "#update_list" do
|
55
|
+
it "updates a list" do
|
56
|
+
json = load_file('list_response.json')
|
57
|
+
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
58
|
+
|
59
|
+
response = RestClient::Response.create(json, net_http_resp, {})
|
60
|
+
RestClient.stub(:put).and_return(response)
|
45
61
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json))
|
46
|
-
added = ConstantContact::Services::ListService.add_list('token', list)
|
47
62
|
|
48
|
-
|
49
|
-
|
63
|
+
result = ConstantContact::Services::ListService.update_list('token', list)
|
64
|
+
result.should be_kind_of(ConstantContact::Components::ContactList)
|
65
|
+
result.status.should eq('ACTIVE')
|
50
66
|
end
|
51
67
|
end
|
52
68
|
|
53
69
|
describe "#get_contacts_from_list" do
|
54
70
|
it "returns an array of contacts" do
|
55
|
-
json_list =
|
56
|
-
json_contacts =
|
71
|
+
json_list = load_file('list_response.json')
|
72
|
+
json_contacts = load_file('contacts_response.json')
|
57
73
|
net_http_resp = Net::HTTPResponse.new(1.0, 200, 'OK')
|
58
74
|
|
59
75
|
response = RestClient::Response.create(json_contacts, net_http_resp, {})
|
60
76
|
RestClient.stub(:get).and_return(response)
|
61
77
|
list = ConstantContact::Components::ContactList.create(JSON.parse(json_list))
|
62
|
-
contacts = ConstantContact::Services::ListService.get_contacts_from_list('token', list)
|
63
|
-
contact = contacts.results[0]
|
64
78
|
|
79
|
+
contacts = ConstantContact::Services::ListService.get_contacts_from_list('token', list)
|
65
80
|
contacts.should be_kind_of(ConstantContact::Components::ResultSet)
|
66
|
-
|
81
|
+
contacts.results.first.should be_kind_of(ConstantContact::Components::Contact)
|
82
|
+
contacts.results.first.fax.should eq('318-978-7575')
|
67
83
|
end
|
68
84
|
end
|
69
85
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -6,8 +6,10 @@
|
|
6
6
|
|
7
7
|
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
8
8
|
require 'constantcontact'
|
9
|
+
#require 'simplecov'
|
9
10
|
|
11
|
+
#SimpleCov.start
|
10
12
|
|
11
|
-
def
|
13
|
+
def load_file(file_name)
|
12
14
|
json = File.read(File.join(File.dirname(__FILE__), 'fixtures', file_name))
|
13
15
|
end
|
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: 1.0
|
4
|
+
version: 1.1.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: 2014-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mime-types
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.25.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.25.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rspec
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,8 +73,9 @@ extensions: []
|
|
59
73
|
extra_rdoc_files: []
|
60
74
|
files:
|
61
75
|
- .rspec
|
62
|
-
- constantcontact.gemspec
|
63
76
|
- README.md
|
77
|
+
- constantcontact.gemspec
|
78
|
+
- lib/constantcontact.rb
|
64
79
|
- lib/constantcontact/api.rb
|
65
80
|
- lib/constantcontact/auth/oauth2.rb
|
66
81
|
- lib/constantcontact/auth/session_data_store.rb
|
@@ -82,6 +97,22 @@ files:
|
|
82
97
|
- lib/constantcontact/components/email_marketing/message_footer.rb
|
83
98
|
- lib/constantcontact/components/email_marketing/schedule.rb
|
84
99
|
- lib/constantcontact/components/email_marketing/test_send.rb
|
100
|
+
- lib/constantcontact/components/event_spot/contact.rb
|
101
|
+
- lib/constantcontact/components/event_spot/event.rb
|
102
|
+
- lib/constantcontact/components/event_spot/event_track.rb
|
103
|
+
- lib/constantcontact/components/event_spot/fee.rb
|
104
|
+
- lib/constantcontact/components/event_spot/guest.rb
|
105
|
+
- lib/constantcontact/components/event_spot/notification_option.rb
|
106
|
+
- lib/constantcontact/components/event_spot/promo_code.rb
|
107
|
+
- lib/constantcontact/components/event_spot/registrant.rb
|
108
|
+
- lib/constantcontact/components/event_spot/registrant_field.rb
|
109
|
+
- lib/constantcontact/components/event_spot/registrant_section.rb
|
110
|
+
- lib/constantcontact/components/event_spot/sale_item.rb
|
111
|
+
- lib/constantcontact/components/library/file/library_file.rb
|
112
|
+
- lib/constantcontact/components/library/folder/library_folder.rb
|
113
|
+
- lib/constantcontact/components/library/info/library_summary.rb
|
114
|
+
- lib/constantcontact/components/library/info/move_results.rb
|
115
|
+
- lib/constantcontact/components/library/info/upload_status.rb
|
85
116
|
- lib/constantcontact/components/result_set.rb
|
86
117
|
- lib/constantcontact/components/tracking/bounce_activity.rb
|
87
118
|
- lib/constantcontact/components/tracking/click_activity.rb
|
@@ -102,11 +133,12 @@ files:
|
|
102
133
|
- lib/constantcontact/services/contact_service.rb
|
103
134
|
- lib/constantcontact/services/contact_tracking_service.rb
|
104
135
|
- lib/constantcontact/services/email_marketing_service.rb
|
136
|
+
- lib/constantcontact/services/event_spot_service.rb
|
137
|
+
- lib/constantcontact/services/library_service.rb
|
105
138
|
- lib/constantcontact/services/list_service.rb
|
106
139
|
- lib/constantcontact/util/config.rb
|
107
140
|
- lib/constantcontact/util/helpers.rb
|
108
141
|
- lib/constantcontact/version.rb
|
109
|
-
- lib/constantcontact.rb
|
110
142
|
- spec/constantcontact/api_spec.rb
|
111
143
|
- spec/constantcontact/auth/oauth2_spec.rb
|
112
144
|
- spec/constantcontact/components/contacts/address_spec.rb
|
@@ -114,8 +146,15 @@ files:
|
|
114
146
|
- spec/constantcontact/components/contacts/contact_spec.rb
|
115
147
|
- spec/constantcontact/components/contacts/custom_field_spec.rb
|
116
148
|
- spec/constantcontact/components/contacts/email_address_spec.rb
|
149
|
+
- spec/constantcontact/services/activity_service_spec.rb
|
150
|
+
- spec/constantcontact/services/base_service_spec.rb
|
151
|
+
- spec/constantcontact/services/campaign_schedule_service_spec.rb
|
152
|
+
- spec/constantcontact/services/campaign_tracking_service_spec.rb
|
117
153
|
- spec/constantcontact/services/contact_service_spec.rb
|
154
|
+
- spec/constantcontact/services/contact_tracking_service_spec.rb
|
118
155
|
- spec/constantcontact/services/email_marketing_spec.rb
|
156
|
+
- spec/constantcontact/services/event_spot_spec.rb
|
157
|
+
- spec/constantcontact/services/library_service_spec.rb
|
119
158
|
- spec/constantcontact/services/list_service_spec.rb
|
120
159
|
- spec/spec_helper.rb
|
121
160
|
homepage: http://www.constantcontact.com
|
@@ -126,7 +165,6 @@ post_install_message:
|
|
126
165
|
rdoc_options: []
|
127
166
|
require_paths:
|
128
167
|
- lib
|
129
|
-
- spec
|
130
168
|
required_ruby_version: !ruby/object:Gem::Requirement
|
131
169
|
requirements:
|
132
170
|
- - '>='
|
@@ -139,8 +177,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
177
|
version: '0'
|
140
178
|
requirements: []
|
141
179
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
180
|
+
rubygems_version: 2.2.1
|
143
181
|
signing_key:
|
144
182
|
specification_version: 4
|
145
183
|
summary: Constant Contact SDK for Ruby
|
146
|
-
test_files:
|
184
|
+
test_files:
|
185
|
+
- spec/constantcontact/api_spec.rb
|
186
|
+
- spec/constantcontact/auth/oauth2_spec.rb
|
187
|
+
- spec/constantcontact/components/contacts/address_spec.rb
|
188
|
+
- spec/constantcontact/components/contacts/contact_list_spec.rb
|
189
|
+
- spec/constantcontact/components/contacts/contact_spec.rb
|
190
|
+
- spec/constantcontact/components/contacts/custom_field_spec.rb
|
191
|
+
- spec/constantcontact/components/contacts/email_address_spec.rb
|
192
|
+
- spec/constantcontact/services/activity_service_spec.rb
|
193
|
+
- spec/constantcontact/services/base_service_spec.rb
|
194
|
+
- spec/constantcontact/services/campaign_schedule_service_spec.rb
|
195
|
+
- spec/constantcontact/services/campaign_tracking_service_spec.rb
|
196
|
+
- spec/constantcontact/services/contact_service_spec.rb
|
197
|
+
- spec/constantcontact/services/contact_tracking_service_spec.rb
|
198
|
+
- spec/constantcontact/services/email_marketing_spec.rb
|
199
|
+
- spec/constantcontact/services/event_spot_spec.rb
|
200
|
+
- spec/constantcontact/services/library_service_spec.rb
|
201
|
+
- spec/constantcontact/services/list_service_spec.rb
|
202
|
+
- spec/spec_helper.rb
|