salsalabs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/.gitignore +4 -0
  2. data/.rspec +1 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +9 -0
  6. data/Gemfile +2 -0
  7. data/README.md +27 -0
  8. data/Rakefile +49 -0
  9. data/lib/salsa_labs/api_response.rb +55 -0
  10. data/lib/salsa_labs/authentication_response.rb +44 -0
  11. data/lib/salsa_labs/configuration.rb +11 -0
  12. data/lib/salsa_labs/connection.rb +91 -0
  13. data/lib/salsa_labs/objects/distributed_event.rb +6 -0
  14. data/lib/salsa_labs/objects/donation.rb +6 -0
  15. data/lib/salsa_labs/objects/event.rb +6 -0
  16. data/lib/salsa_labs/objects/groups.rb +6 -0
  17. data/lib/salsa_labs/objects/supporter.rb +6 -0
  18. data/lib/salsa_labs/objects/supporter_action.rb +6 -0
  19. data/lib/salsa_labs/objects/supporter_action_comment.rb +6 -0
  20. data/lib/salsa_labs/objects/supporter_action_content.rb +6 -0
  21. data/lib/salsa_labs/objects/supporter_action_target.rb +6 -0
  22. data/lib/salsa_labs/objects/supporter_event.rb +6 -0
  23. data/lib/salsa_labs/objects/supporter_groups.rb +6 -0
  24. data/lib/salsa_labs/salsa_object.rb +74 -0
  25. data/lib/salsa_labs/salsa_request_overwrite.rb +30 -0
  26. data/lib/salsa_labs/save_response.rb +29 -0
  27. data/lib/salsa_labs/version.rb +3 -0
  28. data/lib/salsa_labs.rb +75 -0
  29. data/salsalabs.gemspec +28 -0
  30. data/spec/fixtures/auth_error.txt +14 -0
  31. data/spec/fixtures/auth_success.txt +18 -0
  32. data/spec/fixtures/expired_session.txt +12 -0
  33. data/spec/fixtures/malformed_response.txt +11 -0
  34. data/spec/fixtures/supporter/supporter_all.xml +135 -0
  35. data/spec/fixtures/supporter/supporter_count.xml +8 -0
  36. data/spec/fixtures/supporter/supporter_create.xml +1 -0
  37. data/spec/fixtures/supporter/supporter_get.xml +68 -0
  38. data/spec/fixtures/supporter/supporter_update.xml +1 -0
  39. data/spec/fixtures/supporters.txt +346 -0
  40. data/spec/integration/create_supporter_spec.rb +16 -0
  41. data/spec/integration/get_supporter_spec.rb +14 -0
  42. data/spec/spec_helper.rb +30 -0
  43. data/spec/support/fixtures.rb +7 -0
  44. data/spec/support/silence_warnings.rb +9 -0
  45. data/spec/unit/salsa_labs/api_response_spec.rb +82 -0
  46. data/spec/unit/salsa_labs/authentication_response_spec.rb +53 -0
  47. data/spec/unit/salsa_labs/configuration_spec.rb +33 -0
  48. data/spec/unit/salsa_labs/connection_spec.rb +84 -0
  49. data/spec/unit/salsa_labs/objects/supporter_spec.rb +62 -0
  50. data/spec/unit/salsa_labs/salsa_object_spec.rb +11 -0
  51. data/spec/unit/salsa_labs_spec.rb +36 -0
  52. metadata +283 -0
@@ -0,0 +1,18 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/1.0.0
3
+ Date: Fri, 26 Jul 2013 06:40:59 GMT
4
+ Content-Type: text/xml;charset=UTF-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Keep-Alive: timeout=20
8
+ Set-Cookie: JSESSIONID=A1737DC1330748B01456B3C269162AB6-n3; Path=/; Secure; HttpOnly
9
+ RequestURI: /api/authenticate.sjs?email=jane@doe.com&password=password
10
+ Set-Cookie: hqtab_2=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT
11
+ Set-Cookie: READONLY_Short_Name=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT
12
+ Set-Cookie: SRV=sandbox; path=/
13
+ Cache-control: private
14
+
15
+ <?xml version="1.0"?>
16
+ <data organization_KEY="99999">
17
+ <message>Successful Login</message>
18
+ </data>
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/1.0.0
3
+ Date: Tue, 30 Jul 2013 08:30:20 GMT
4
+ Content-Type: text/xml;charset=UTF-8
5
+ Connection: close
6
+ RequestURI: /api/getObjects.sjs?object=supporter
7
+ Set-Cookie: JSESSIONID=EEF5998FA6D5CDDC179920762A143F9E-n4; Path=/; Secure; HttpOnly, SRV=sandbox; path=/
8
+ Cache-Control: private
9
+ Transfer-Encoding: Identity
10
+
11
+ <?xml version="1.0"?>
12
+ <data><error exc="There was a problem with your submission. Please authenticate in order to continue.">There was a problem with your submission. Please authenticate in order to continue.</error></data>
@@ -0,0 +1,11 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/1.0.0
3
+ Date: Tue, 30 Jul 2013 08:30:20 GMT
4
+ Content-Type: text/xml;charset=UTF-8
5
+ Connection: close
6
+ RequestURI: /api/getObjects.sjs?object=supporter
7
+ Set-Cookie: JSESSIONID=DDC179920EEF5998FA6D5C762A143F9E-n4; Path=/; Secure; HttpOnly, SRV=sandbox; path=/
8
+ Cache-Control: private
9
+ Transfer-Encoding: Identity
10
+
11
+ <?xml version="1.0"?>
@@ -0,0 +1,135 @@
1
+ <supporter>
2
+ <item>
3
+ <supporter_KEY>99999999</supporter_KEY>
4
+ <organization_KEY>99999</organization_KEY>
5
+ <chapter_KEY>0</chapter_KEY>
6
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
7
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
8
+ <Title/>
9
+ <First_Name>Jane</First_Name>
10
+ <MI/>
11
+ <Last_Name>Doe</Last_Name>
12
+ <Suffix/>
13
+ <Email/>
14
+ <Password/>
15
+ <Receive_Email>1</Receive_Email>
16
+ <Email_Status/>
17
+ <Email_Preference/>
18
+ <Soft_Bounce_Count/>
19
+ <Hard_Bounce_Count/>
20
+ <Last_Bounce/>
21
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
22
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
23
+ <Phone>4159999999</Phone>
24
+ <Cell_Phone/>
25
+ <Phone_Provider/>
26
+ <Work_Phone/>
27
+ <Pager/>
28
+ <Home_Fax/>
29
+ <Work_Fax/>
30
+ <Street/>
31
+ <Street_2/>
32
+ <Street_3/>
33
+ <City/>
34
+ <State/>
35
+ <Zip>11111</Zip>
36
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
37
+ <County/>
38
+ <District/>
39
+ <Country/>
40
+ <Latitude/>
41
+ <Longitude/>
42
+ <Organization/>
43
+ <Department/>
44
+ <Occupation/>
45
+ <Instant_Messenger_Service/>
46
+ <Instant_Messenger_Name/>
47
+ <Web_Page/>
48
+ <Alternative_Email/>
49
+ <Other_Data_1/>
50
+ <Other_Data_2/>
51
+ <Other_Data_3/>
52
+ <Notes/>
53
+ <Source>Web</Source>
54
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
55
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
56
+ <Tracking_Code/>
57
+ <Status/>
58
+ <uid/>
59
+ <Timezone/>
60
+ <Language_Code/>
61
+ <fbuid/>
62
+ <fbtoken/>
63
+ <last_action_dedication/>
64
+ <split_atom_face_pic/>
65
+ <key>99999999</key>
66
+ <object>supporter</object>
67
+ </item>
68
+ <item>
69
+ <supporter_KEY>88888888</supporter_KEY>
70
+ <organization_KEY>99999</organization_KEY>
71
+ <chapter_KEY>0</chapter_KEY>
72
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
73
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
74
+ <Title/>
75
+ <First_Name>Jane</First_Name>
76
+ <MI/>
77
+ <Last_Name>Doe</Last_Name>
78
+ <Suffix/>
79
+ <Email/>
80
+ <Password/>
81
+ <Receive_Email>1</Receive_Email>
82
+ <Email_Status/>
83
+ <Email_Preference/>
84
+ <Soft_Bounce_Count/>
85
+ <Hard_Bounce_Count/>
86
+ <Last_Bounce/>
87
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
88
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
89
+ <Phone>4158888888</Phone>
90
+ <Cell_Phone/>
91
+ <Phone_Provider/>
92
+ <Work_Phone/>
93
+ <Pager/>
94
+ <Home_Fax/>
95
+ <Work_Fax/>
96
+ <Street/>
97
+ <Street_2/>
98
+ <Street_3/>
99
+ <City/>
100
+ <State/>
101
+ <Zip>22222</Zip>
102
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
103
+ <County/>
104
+ <District/>
105
+ <Country/>
106
+ <Latitude/>
107
+ <Longitude/>
108
+ <Organization/>
109
+ <Department/>
110
+ <Occupation/>
111
+ <Instant_Messenger_Service/>
112
+ <Instant_Messenger_Name/>
113
+ <Web_Page/>
114
+ <Alternative_Email/>
115
+ <Other_Data_1/>
116
+ <Other_Data_2/>
117
+ <Other_Data_3/>
118
+ <Notes/>
119
+ <Source>Web</Source>
120
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
121
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
122
+ <Tracking_Code/>
123
+ <Status/>
124
+ <uid/>
125
+ <Timezone/>
126
+ <Language_Code/>
127
+ <fbuid/>
128
+ <fbtoken/>
129
+ <last_action_dedication/>
130
+ <split_atom_face_pic/>
131
+ <key>88888888</key>
132
+ <object>supporter</object>
133
+ </item>
134
+ <count>2</count>
135
+ </supporter>
@@ -0,0 +1,8 @@
1
+ <supporter>
2
+ <count>
3
+ <count>12</count>
4
+ <sum>1333249499</sum>
5
+ <max>33035720</max>
6
+ <min>31540043</min>
7
+ </count>
8
+ </supporter>
@@ -0,0 +1 @@
1
+ <success object="supporter" key="12345678">Modified entry 12345678</success>
@@ -0,0 +1,68 @@
1
+ <supporter>
2
+ <item>
3
+ <supporter_KEY>99999999</supporter_KEY>
4
+ <organization_KEY>99999</organization_KEY>
5
+ <chapter_KEY>0</chapter_KEY>
6
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
7
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
8
+ <Title/>
9
+ <First_Name>Jane</First_Name>
10
+ <MI/>
11
+ <Last_Name>Doe</Last_Name>
12
+ <Suffix/>
13
+ <Email/>
14
+ <Password/>
15
+ <Receive_Email>1</Receive_Email>
16
+ <Email_Status/>
17
+ <Email_Preference/>
18
+ <Soft_Bounce_Count/>
19
+ <Hard_Bounce_Count/>
20
+ <Last_Bounce/>
21
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
22
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
23
+ <Phone>4159999999</Phone>
24
+ <Cell_Phone/>
25
+ <Phone_Provider/>
26
+ <Work_Phone/>
27
+ <Pager/>
28
+ <Home_Fax/>
29
+ <Work_Fax/>
30
+ <Street/>
31
+ <Street_2/>
32
+ <Street_3/>
33
+ <City/>
34
+ <State/>
35
+ <Zip>11111</Zip>
36
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
37
+ <County/>
38
+ <District/>
39
+ <Country/>
40
+ <Latitude/>
41
+ <Longitude/>
42
+ <Organization/>
43
+ <Department/>
44
+ <Occupation/>
45
+ <Instant_Messenger_Service/>
46
+ <Instant_Messenger_Name/>
47
+ <Web_Page/>
48
+ <Alternative_Email/>
49
+ <Other_Data_1/>
50
+ <Other_Data_2/>
51
+ <Other_Data_3/>
52
+ <Notes/>
53
+ <Source>Web</Source>
54
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
55
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
56
+ <Tracking_Code/>
57
+ <Status/>
58
+ <uid/>
59
+ <Timezone/>
60
+ <Language_Code/>
61
+ <fbuid/>
62
+ <fbtoken/>
63
+ <last_action_dedication/>
64
+ <split_atom_face_pic/>
65
+ <key>99999999</key>
66
+ <object>supporter</object>
67
+ </item>
68
+ </supporter>
@@ -0,0 +1 @@
1
+ <success object="supporter" key="12345678">Modified entry 12345678</success>
@@ -0,0 +1,346 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx/1.0.0
3
+ Date: Tue, 30 Jul 2013 06:15:31 GMT
4
+ Content-Type: text/xml;charset=UTF-8
5
+ Connection: close
6
+ RequestURI: /api/getObjects.sjs?object=supporter&limit=5
7
+ Set-Cookie: SRV=sandbox; path=/
8
+ Cache-Control: private
9
+ Transfer-Encoding: Identity
10
+
11
+ <?xml version="1.0"?>
12
+ <data organization_KEY="17270">
13
+ <supporter>
14
+ <item>
15
+ <supporter_KEY>99999999</supporter_KEY>
16
+ <organization_KEY>99999</organization_KEY>
17
+ <chapter_KEY>0</chapter_KEY>
18
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
19
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
20
+ <Title/>
21
+ <First_Name>Jane</First_Name>
22
+ <MI/>
23
+ <Last_Name>Doe</Last_Name>
24
+ <Suffix/>
25
+ <Email/>
26
+ <Password/>
27
+ <Receive_Email>1</Receive_Email>
28
+ <Email_Status/>
29
+ <Email_Preference/>
30
+ <Soft_Bounce_Count/>
31
+ <Hard_Bounce_Count/>
32
+ <Last_Bounce/>
33
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
34
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
35
+ <Phone>4159999999</Phone>
36
+ <Cell_Phone/>
37
+ <Phone_Provider/>
38
+ <Work_Phone/>
39
+ <Pager/>
40
+ <Home_Fax/>
41
+ <Work_Fax/>
42
+ <Street/>
43
+ <Street_2/>
44
+ <Street_3/>
45
+ <City/>
46
+ <State/>
47
+ <Zip>11111</Zip>
48
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
49
+ <County/>
50
+ <District/>
51
+ <Country/>
52
+ <Latitude/>
53
+ <Longitude/>
54
+ <Organization/>
55
+ <Department/>
56
+ <Occupation/>
57
+ <Instant_Messenger_Service/>
58
+ <Instant_Messenger_Name/>
59
+ <Web_Page/>
60
+ <Alternative_Email/>
61
+ <Other_Data_1/>
62
+ <Other_Data_2/>
63
+ <Other_Data_3/>
64
+ <Notes/>
65
+ <Source>Web</Source>
66
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
67
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
68
+ <Tracking_Code/>
69
+ <Status/>
70
+ <uid/>
71
+ <Timezone/>
72
+ <Language_Code/>
73
+ <fbuid/>
74
+ <fbtoken/>
75
+ <last_action_dedication/>
76
+ <split_atom_face_pic/>
77
+ <key>99999999</key>
78
+ <object>supporter</object>
79
+ </item>
80
+ <item>
81
+ <supporter_KEY>88888888</supporter_KEY>
82
+ <organization_KEY>99999</organization_KEY>
83
+ <chapter_KEY>0</chapter_KEY>
84
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
85
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
86
+ <Title/>
87
+ <First_Name>Jane</First_Name>
88
+ <MI/>
89
+ <Last_Name>Doe</Last_Name>
90
+ <Suffix/>
91
+ <Email/>
92
+ <Password/>
93
+ <Receive_Email>1</Receive_Email>
94
+ <Email_Status/>
95
+ <Email_Preference/>
96
+ <Soft_Bounce_Count/>
97
+ <Hard_Bounce_Count/>
98
+ <Last_Bounce/>
99
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
100
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
101
+ <Phone>4158888888</Phone>
102
+ <Cell_Phone/>
103
+ <Phone_Provider/>
104
+ <Work_Phone/>
105
+ <Pager/>
106
+ <Home_Fax/>
107
+ <Work_Fax/>
108
+ <Street/>
109
+ <Street_2/>
110
+ <Street_3/>
111
+ <City/>
112
+ <State/>
113
+ <Zip>22222</Zip>
114
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
115
+ <County/>
116
+ <District/>
117
+ <Country/>
118
+ <Latitude/>
119
+ <Longitude/>
120
+ <Organization/>
121
+ <Department/>
122
+ <Occupation/>
123
+ <Instant_Messenger_Service/>
124
+ <Instant_Messenger_Name/>
125
+ <Web_Page/>
126
+ <Alternative_Email/>
127
+ <Other_Data_1/>
128
+ <Other_Data_2/>
129
+ <Other_Data_3/>
130
+ <Notes/>
131
+ <Source>Web</Source>
132
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
133
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
134
+ <Tracking_Code/>
135
+ <Status/>
136
+ <uid/>
137
+ <Timezone/>
138
+ <Language_Code/>
139
+ <fbuid/>
140
+ <fbtoken/>
141
+ <last_action_dedication/>
142
+ <split_atom_face_pic/>
143
+ <key>88888888</key>
144
+ <object>supporter</object>
145
+ </item>
146
+ <item>
147
+ <supporter_KEY>77777777</supporter_KEY>
148
+ <organization_KEY>99999</organization_KEY>
149
+ <chapter_KEY>0</chapter_KEY>
150
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
151
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
152
+ <Title/>
153
+ <First_Name>Jane</First_Name>
154
+ <MI/>
155
+ <Last_Name>Doe</Last_Name>
156
+ <Suffix/>
157
+ <Email/>
158
+ <Password/>
159
+ <Receive_Email>1</Receive_Email>
160
+ <Email_Status/>
161
+ <Email_Preference/>
162
+ <Soft_Bounce_Count/>
163
+ <Hard_Bounce_Count/>
164
+ <Last_Bounce/>
165
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
166
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
167
+ <Phone>4157777777</Phone>
168
+ <Cell_Phone/>
169
+ <Phone_Provider/>
170
+ <Work_Phone/>
171
+ <Pager/>
172
+ <Home_Fax/>
173
+ <Work_Fax/>
174
+ <Street/>
175
+ <Street_2/>
176
+ <Street_3/>
177
+ <City/>
178
+ <State/>
179
+ <Zip>33333</Zip>
180
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
181
+ <County/>
182
+ <District/>
183
+ <Country/>
184
+ <Latitude/>
185
+ <Longitude/>
186
+ <Organization/>
187
+ <Department/>
188
+ <Occupation/>
189
+ <Instant_Messenger_Service/>
190
+ <Instant_Messenger_Name/>
191
+ <Web_Page/>
192
+ <Alternative_Email/>
193
+ <Other_Data_1/>
194
+ <Other_Data_2/>
195
+ <Other_Data_3/>
196
+ <Notes/>
197
+ <Source>Web</Source>
198
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
199
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
200
+ <Tracking_Code/>
201
+ <Status/>
202
+ <uid/>
203
+ <Timezone/>
204
+ <Language_Code/>
205
+ <fbuid/>
206
+ <fbtoken/>
207
+ <last_action_dedication/>
208
+ <split_atom_face_pic/>
209
+ <key>77777777</key>
210
+ <object>supporter</object>
211
+ </item>
212
+ <item>
213
+ <supporter_KEY>66666666</supporter_KEY>
214
+ <organization_KEY>99999</organization_KEY>
215
+ <chapter_KEY>0</chapter_KEY>
216
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
217
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
218
+ <Title/>
219
+ <First_Name>Jane</First_Name>
220
+ <MI/>
221
+ <Last_Name>Doe</Last_Name>
222
+ <Suffix/>
223
+ <Email/>
224
+ <Password/>
225
+ <Receive_Email>1</Receive_Email>
226
+ <Email_Status/>
227
+ <Email_Preference/>
228
+ <Soft_Bounce_Count/>
229
+ <Hard_Bounce_Count/>
230
+ <Last_Bounce/>
231
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
232
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
233
+ <Phone>4156666666</Phone>
234
+ <Cell_Phone/>
235
+ <Phone_Provider/>
236
+ <Work_Phone/>
237
+ <Pager/>
238
+ <Home_Fax/>
239
+ <Work_Fax/>
240
+ <Street/>
241
+ <Street_2/>
242
+ <Street_3/>
243
+ <City/>
244
+ <State/>
245
+ <Zip>44444</Zip>
246
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
247
+ <County/>
248
+ <District/>
249
+ <Country/>
250
+ <Latitude/>
251
+ <Longitude/>
252
+ <Organization/>
253
+ <Department/>
254
+ <Occupation/>
255
+ <Instant_Messenger_Service/>
256
+ <Instant_Messenger_Name/>
257
+ <Web_Page/>
258
+ <Alternative_Email/>
259
+ <Other_Data_1/>
260
+ <Other_Data_2/>
261
+ <Other_Data_3/>
262
+ <Notes/>
263
+ <Source>Web</Source>
264
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
265
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
266
+ <Tracking_Code/>
267
+ <Status/>
268
+ <uid/>
269
+ <Timezone/>
270
+ <Language_Code/>
271
+ <fbuid/>
272
+ <fbtoken/>
273
+ <last_action_dedication/>
274
+ <split_atom_face_pic/>
275
+ <key>66666666</key>
276
+ <object>supporter</object>
277
+ </item>
278
+ <item>
279
+ <supporter_KEY>55555555</supporter_KEY>
280
+ <organization_KEY>99999</organization_KEY>
281
+ <chapter_KEY>0</chapter_KEY>
282
+ <Last_Modified>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Last_Modified>
283
+ <Date_Created>Tue Aug 10 2010 15:13:10 GMT-0400 (EDT)</Date_Created>
284
+ <Title/>
285
+ <First_Name>Jane</First_Name>
286
+ <MI/>
287
+ <Last_Name>Doe</Last_Name>
288
+ <Suffix/>
289
+ <Email/>
290
+ <Password/>
291
+ <Receive_Email>1</Receive_Email>
292
+ <Email_Status/>
293
+ <Email_Preference/>
294
+ <Soft_Bounce_Count/>
295
+ <Hard_Bounce_Count/>
296
+ <Last_Bounce/>
297
+ <Receive_Phone_Blasts_BOOLVALUE>false</Receive_Phone_Blasts_BOOLVALUE>
298
+ <Receive_Phone_Blasts>false</Receive_Phone_Blasts>
299
+ <Phone>4155555555</Phone>
300
+ <Cell_Phone/>
301
+ <Phone_Provider/>
302
+ <Work_Phone/>
303
+ <Pager/>
304
+ <Home_Fax/>
305
+ <Work_Fax/>
306
+ <Street/>
307
+ <Street_2/>
308
+ <Street_3/>
309
+ <City/>
310
+ <State/>
311
+ <Zip>55555</Zip>
312
+ <PRIVATE_Zip_Plus_4>0000</PRIVATE_Zip_Plus_4>
313
+ <County/>
314
+ <District/>
315
+ <Country/>
316
+ <Latitude/>
317
+ <Longitude/>
318
+ <Organization/>
319
+ <Department/>
320
+ <Occupation/>
321
+ <Instant_Messenger_Service/>
322
+ <Instant_Messenger_Name/>
323
+ <Web_Page/>
324
+ <Alternative_Email/>
325
+ <Other_Data_1/>
326
+ <Other_Data_2/>
327
+ <Other_Data_3/>
328
+ <Notes/>
329
+ <Source>Web</Source>
330
+ <Source_Details>http://sandbox.wiredforchange.com/o/17270/p/dia/action3/common/public/?action_KEY=425</Source_Details>
331
+ <Source_Tracking_Code>(No Original Source Available)</Source_Tracking_Code>
332
+ <Tracking_Code/>
333
+ <Status/>
334
+ <uid/>
335
+ <Timezone/>
336
+ <Language_Code/>
337
+ <fbuid/>
338
+ <fbtoken/>
339
+ <last_action_dedication/>
340
+ <split_atom_face_pic/>
341
+ <key>55555555</key>
342
+ <object>supporter</object>
343
+ </item>
344
+ <count>5</count>
345
+ </supporter>
346
+ </data>
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'POST Supporter', type: :integration do
4
+ subject do
5
+ SalsaLabs::Supporter.create(
6
+ :First_Name => 'IntegrationSpec',
7
+ :Last_Name => Time.now.to_i.to_s
8
+ )
9
+ end
10
+
11
+ it 'creates the supporter' do
12
+ expect(subject).to be_a(String)
13
+ created_object = SalsaLabs::Supporter.get(subject)
14
+ expect(subject).to eq(created_object['key'])
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'GET Supporter', type: :integration do
4
+ subject { SalsaLabs::Supporter.get('31757704') }
5
+
6
+ it 'returns a hash' do
7
+ expect(subject).to be_a(Hash)
8
+ end
9
+
10
+ it 'returns the correct record' do
11
+ expect(subject.key?('supporter_KEY')).to be_true
12
+ expect(subject['supporter_KEY']).to eq('31757704')
13
+ end
14
+ end
@@ -0,0 +1,30 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'..','lib'))
3
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support'))
4
+
5
+ require 'bundler/setup'
6
+ require 'salsa_labs'
7
+ require 'rspec'
8
+ require 'webmock/rspec'
9
+ require 'fixtures'
10
+
11
+ silence_warnings { require 'pry-debugger' }
12
+
13
+ RSpec.configure do |config|
14
+ config.order = :rand
15
+
16
+ config.include(Fixtures)
17
+
18
+ config.around :each, type: :integration do |example|
19
+ WebMock.disable!
20
+
21
+ SalsaLabs.configure do |c|
22
+ c.email = ENV['SALSA_USERNAME']
23
+ c.password = ENV['SALSA_PASSWORD']
24
+ end
25
+
26
+ example.run
27
+
28
+ WebMock.enable!
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ module Fixtures
2
+ def fixture_file(filename)
3
+ File.new("spec/fixtures/#{filename}")
4
+ rescue Errno::ENOENT
5
+ nil
6
+ end
7
+ end