rock_rms 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -3
  3. data/lib/rock_rms/client.rb +3 -0
  4. data/lib/rock_rms/error.rb +1 -1
  5. data/lib/rock_rms/resources/group.rb +35 -0
  6. data/lib/rock_rms/resources/group_member.rb +32 -0
  7. data/lib/rock_rms/resources/person.rb +16 -6
  8. data/lib/rock_rms/resources/phone_number.rb +15 -0
  9. data/lib/rock_rms/responses/campus.rb +34 -0
  10. data/lib/rock_rms/responses/group.rb +42 -0
  11. data/lib/rock_rms/responses/group_location.rb +34 -0
  12. data/lib/rock_rms/responses/location.rb +37 -0
  13. data/lib/rock_rms/responses/person.rb +29 -17
  14. data/lib/rock_rms/responses/phone_number.rb +27 -0
  15. data/lib/rock_rms/version.rb +1 -1
  16. data/spec/rock_rms/client_spec.rb +3 -3
  17. data/spec/rock_rms/resources/group_member_spec.rb +67 -0
  18. data/spec/rock_rms/resources/group_spec.rb +111 -0
  19. data/spec/rock_rms/resources/person_spec.rb +50 -0
  20. data/spec/rock_rms/resources/phone_number_spec.rb +34 -0
  21. data/spec/rock_rms/responses/campus_spec.rb +30 -0
  22. data/spec/rock_rms/responses/group_location_spec.rb +36 -0
  23. data/spec/rock_rms/responses/group_spec.rb +52 -0
  24. data/spec/rock_rms/responses/location_spec.rb +33 -0
  25. data/spec/rock_rms/responses/phone_number_spec.rb +25 -0
  26. data/spec/spec_helper.rb +5 -0
  27. data/spec/support/client_factory.rb +12 -0
  28. data/spec/support/fixtures/campuses.json +23 -0
  29. data/spec/support/fixtures/create_group_member.json +1 -0
  30. data/spec/support/fixtures/families.json +45 -0
  31. data/spec/support/fixtures/group.json +43 -0
  32. data/spec/support/fixtures/group_locations.json +60 -0
  33. data/spec/support/fixtures/groups.json +32 -0
  34. data/spec/support/fixtures/groups_with_campus.json +53 -0
  35. data/spec/support/fixtures/groups_with_locations.json +92 -0
  36. data/spec/support/fixtures/groups_with_members.json +454 -0
  37. data/spec/support/fixtures/locations.json +42 -0
  38. data/spec/support/fixtures/people_search.json +36 -0
  39. data/spec/support/fixtures/phone_numbers.json +28 -0
  40. data/spec/support/fixtures_helper.rb +5 -0
  41. data/spec/support/rock_mock.rb +41 -0
  42. metadata +33 -2
@@ -0,0 +1,454 @@
1
+ [
2
+ {
3
+ "Members": [
4
+ {
5
+ "GroupRole": {
6
+ "IsSystem": true,
7
+ "GroupTypeId": 12345,
8
+ "Name": "Member",
9
+ "Description": null,
10
+ "Order": 0,
11
+ "MaxCount": null,
12
+ "MinCount": null,
13
+ "IsLeader": false,
14
+ "ReceiveRequirementsNotifications": false,
15
+ "CanView": false,
16
+ "CanEdit": false,
17
+ "CreatedDateTime": null,
18
+ "ModifiedDateTime": null,
19
+ "CreatedByPersonAliasId": null,
20
+ "ModifiedByPersonAliasId": null,
21
+ "Id": 1234,
22
+ "Guid": "38ee341a",
23
+ "ForeignId": null,
24
+ "ForeignGuid": null,
25
+ "ForeignKey": null
26
+ },
27
+ "IsSystem": false,
28
+ "GroupId": 1234,
29
+ "PersonId": 1234,
30
+ "GroupRoleId": 1234,
31
+ "Note": null,
32
+ "GroupMemberStatus": 2,
33
+ "GuestCount": null,
34
+ "DateTimeAdded": "2017-11-12T14:06:06.147",
35
+ "IsNotified": false,
36
+ "CreatedDateTime": null,
37
+ "ModifiedDateTime": null,
38
+ "CreatedByPersonAliasId": null,
39
+ "ModifiedByPersonAliasId": null,
40
+ "Id": 12345,
41
+ "Guid": "82297ae1-60f2-4625-9107-fe455cb71546",
42
+ "ForeignId": null,
43
+ "ForeignGuid": "ba153b60-4ec6-4d88-8f7e-b6a9486ca76e",
44
+ "ForeignKey": null
45
+ },
46
+ {
47
+ "GroupRole": {
48
+ "IsSystem": true,
49
+ "GroupTypeId": 1455,
50
+ "Name": "Assistant Leader",
51
+ "Description": null,
52
+ "Order": 1,
53
+ "MaxCount": null,
54
+ "MinCount": null,
55
+ "IsLeader": false,
56
+ "ReceiveRequirementsNotifications": false,
57
+ "CanView": false,
58
+ "CanEdit": false,
59
+ "CreatedDateTime": null,
60
+ "ModifiedDateTime": null,
61
+ "CreatedByPersonAliasId": null,
62
+ "ModifiedByPersonAliasId": null,
63
+ "Id": 1233,
64
+ "Guid": "5fbc6882",
65
+ "ForeignId": null,
66
+ "ForeignGuid": null,
67
+ "ForeignKey": null
68
+ },
69
+ "IsSystem": false,
70
+ "GroupId": 1234,
71
+ "PersonId": 14190,
72
+ "GroupRoleId": 182,
73
+ "Note": null,
74
+ "GroupMemberStatus": 1,
75
+ "GuestCount": null,
76
+ "DateTimeAdded": "2017-11-12T14:04:56.85",
77
+ "IsNotified": false,
78
+ "CreatedDateTime": null,
79
+ "ModifiedDateTime": null,
80
+ "CreatedByPersonAliasId": null,
81
+ "ModifiedByPersonAliasId": null,
82
+ "Id": 442340,
83
+ "Guid": "4e243d12",
84
+ "ForeignId": null,
85
+ "ForeignGuid": "cad6b99d",
86
+ "ForeignKey": null
87
+ },
88
+ {
89
+ "GroupRole": {
90
+ "IsSystem": true,
91
+ "GroupTypeId": 12345,
92
+ "Name": "Leader",
93
+ "Description": null,
94
+ "Order": 7,
95
+ "MaxCount": null,
96
+ "MinCount": null,
97
+ "IsLeader": true,
98
+ "ReceiveRequirementsNotifications": false,
99
+ "CanView": true,
100
+ "CanEdit": true,
101
+ "CreatedDateTime": null,
102
+ "ModifiedDateTime": null,
103
+ "CreatedByPersonAliasId": null,
104
+ "ModifiedByPersonAliasId": null,
105
+ "Id": 188,
106
+ "Guid": "2030c373",
107
+ "ForeignId": null,
108
+ "ForeignGuid": null,
109
+ "ForeignKey": null
110
+ },
111
+ "IsSystem": false,
112
+ "GroupId": 1234,
113
+ "PersonId": 23641,
114
+ "GroupRoleId": 188,
115
+ "Note": null,
116
+ "GroupMemberStatus": 1,
117
+ "GuestCount": null,
118
+ "DateTimeAdded": null,
119
+ "IsNotified": false,
120
+ "CreatedDateTime": null,
121
+ "ModifiedDateTime": null,
122
+ "CreatedByPersonAliasId": null,
123
+ "ModifiedByPersonAliasId": null,
124
+ "Id": 442339,
125
+ "Guid": "bf174b2f",
126
+ "ForeignId": null,
127
+ "ForeignGuid": null,
128
+ "ForeignKey": null
129
+ },
130
+ {
131
+ "GroupRole": {
132
+ "IsSystem": true,
133
+ "GroupTypeId": 12345,
134
+ "Name": "Member",
135
+ "Description": null,
136
+ "Order": 0,
137
+ "MaxCount": null,
138
+ "MinCount": null,
139
+ "IsLeader": false,
140
+ "ReceiveRequirementsNotifications": false,
141
+ "CanView": false,
142
+ "CanEdit": false,
143
+ "CreatedDateTime": null,
144
+ "ModifiedDateTime": null,
145
+ "CreatedByPersonAliasId": null,
146
+ "ModifiedByPersonAliasId": null,
147
+ "Id": 1234,
148
+ "Guid": "38ee341a",
149
+ "ForeignId": null,
150
+ "ForeignGuid": null,
151
+ "ForeignKey": null
152
+ },
153
+ "IsSystem": false,
154
+ "GroupId": 1234,
155
+ "PersonId": 49192,
156
+ "GroupRoleId": 181,
157
+ "Note": null,
158
+ "GroupMemberStatus": 1,
159
+ "GuestCount": null,
160
+ "DateTimeAdded": "2017-11-12T14:05:58.737",
161
+ "IsNotified": false,
162
+ "CreatedDateTime": null,
163
+ "ModifiedDateTime": null,
164
+ "CreatedByPersonAliasId": null,
165
+ "ModifiedByPersonAliasId": null,
166
+ "Id": 442347,
167
+ "Guid": "51237380",
168
+ "ForeignId": null,
169
+ "ForeignGuid": "3c3adc62",
170
+ "ForeignKey": null
171
+ },
172
+ {
173
+ "GroupRole": {
174
+ "IsSystem": true,
175
+ "GroupTypeId": 12345,
176
+ "Name": "Member",
177
+ "Description": null,
178
+ "Order": 0,
179
+ "MaxCount": null,
180
+ "MinCount": null,
181
+ "IsLeader": false,
182
+ "ReceiveRequirementsNotifications": false,
183
+ "CanView": false,
184
+ "CanEdit": false,
185
+ "CreatedDateTime": null,
186
+ "ModifiedDateTime": null,
187
+ "CreatedByPersonAliasId": null,
188
+ "ModifiedByPersonAliasId": null,
189
+ "Id": 1234,
190
+ "Guid": "38ee341a",
191
+ "ForeignId": null,
192
+ "ForeignGuid": null,
193
+ "ForeignKey": null
194
+ },
195
+ "IsSystem": false,
196
+ "GroupId": 1234,
197
+ "PersonId": 56735,
198
+ "GroupRoleId": 181,
199
+ "Note": null,
200
+ "GroupMemberStatus": 1,
201
+ "GuestCount": null,
202
+ "DateTimeAdded": "2017-11-12T14:05:52.53",
203
+ "IsNotified": false,
204
+ "CreatedDateTime": null,
205
+ "ModifiedDateTime": null,
206
+ "CreatedByPersonAliasId": null,
207
+ "ModifiedByPersonAliasId": null,
208
+ "Id": 442346,
209
+ "Guid": "48a4c4c2",
210
+ "ForeignId": null,
211
+ "ForeignGuid": "c3177a27",
212
+ "ForeignKey": null
213
+ },
214
+ {
215
+ "GroupRole": {
216
+ "IsSystem": true,
217
+ "GroupTypeId": 12345,
218
+ "Name": "Member",
219
+ "Description": null,
220
+ "Order": 0,
221
+ "MaxCount": null,
222
+ "MinCount": null,
223
+ "IsLeader": false,
224
+ "ReceiveRequirementsNotifications": false,
225
+ "CanView": false,
226
+ "CanEdit": false,
227
+ "CreatedDateTime": null,
228
+ "ModifiedDateTime": null,
229
+ "CreatedByPersonAliasId": null,
230
+ "ModifiedByPersonAliasId": null,
231
+ "Id": 1234,
232
+ "Guid": "38ee341a",
233
+ "ForeignId": null,
234
+ "ForeignGuid": null,
235
+ "ForeignKey": null
236
+ },
237
+ "IsSystem": false,
238
+ "GroupId": 1234,
239
+ "PersonId": 58677,
240
+ "GroupRoleId": 181,
241
+ "Note": null,
242
+ "GroupMemberStatus": 1,
243
+ "GuestCount": null,
244
+ "DateTimeAdded": "2017-11-12T14:05:45.65",
245
+ "IsNotified": false,
246
+ "CreatedDateTime": null,
247
+ "ModifiedDateTime": null,
248
+ "CreatedByPersonAliasId": null,
249
+ "ModifiedByPersonAliasId": null,
250
+ "Id": 442345,
251
+ "Guid": "a0308164",
252
+ "ForeignId": null,
253
+ "ForeignGuid": "c03b850d",
254
+ "ForeignKey": null
255
+ },
256
+ {
257
+ "GroupRole": {
258
+ "IsSystem": true,
259
+ "GroupTypeId": 12345,
260
+ "Name": "Member",
261
+ "Description": null,
262
+ "Order": 0,
263
+ "MaxCount": null,
264
+ "MinCount": null,
265
+ "IsLeader": false,
266
+ "ReceiveRequirementsNotifications": false,
267
+ "CanView": false,
268
+ "CanEdit": false,
269
+ "CreatedDateTime": null,
270
+ "ModifiedDateTime": null,
271
+ "CreatedByPersonAliasId": null,
272
+ "ModifiedByPersonAliasId": null,
273
+ "Id": 1234,
274
+ "Guid": "38ee341a",
275
+ "ForeignId": null,
276
+ "ForeignGuid": null,
277
+ "ForeignKey": null
278
+ },
279
+ "IsSystem": false,
280
+ "GroupId": 1234,
281
+ "PersonId": 71503,
282
+ "GroupRoleId": 181,
283
+ "Note": null,
284
+ "GroupMemberStatus": 1,
285
+ "GuestCount": null,
286
+ "DateTimeAdded": "2017-11-12T14:06:15.697",
287
+ "IsNotified": false,
288
+ "CreatedDateTime": null,
289
+ "ModifiedDateTime": null,
290
+ "CreatedByPersonAliasId": null,
291
+ "ModifiedByPersonAliasId": null,
292
+ "Id": 442349,
293
+ "Guid": "0ae46d85",
294
+ "ForeignId": null,
295
+ "ForeignGuid": "f930eba3",
296
+ "ForeignKey": null
297
+ },
298
+ {
299
+ "GroupRole": {
300
+ "IsSystem": true,
301
+ "GroupTypeId": 12345,
302
+ "Name": "Member",
303
+ "Description": null,
304
+ "Order": 0,
305
+ "MaxCount": null,
306
+ "MinCount": null,
307
+ "IsLeader": false,
308
+ "ReceiveRequirementsNotifications": false,
309
+ "CanView": false,
310
+ "CanEdit": false,
311
+ "CreatedDateTime": null,
312
+ "ModifiedDateTime": null,
313
+ "CreatedByPersonAliasId": null,
314
+ "ModifiedByPersonAliasId": null,
315
+ "Id": 1234,
316
+ "Guid": "38ee341a",
317
+ "ForeignId": null,
318
+ "ForeignGuid": null,
319
+ "ForeignKey": null
320
+ },
321
+ "IsSystem": false,
322
+ "GroupId": 1234,
323
+ "PersonId": 76636,
324
+ "GroupRoleId": 181,
325
+ "Note": null,
326
+ "GroupMemberStatus": 1,
327
+ "GuestCount": null,
328
+ "DateTimeAdded": "2017-11-12T14:05:14.4",
329
+ "IsNotified": false,
330
+ "CreatedDateTime": null,
331
+ "ModifiedDateTime": null,
332
+ "CreatedByPersonAliasId": null,
333
+ "ModifiedByPersonAliasId": null,
334
+ "Id": 442341,
335
+ "Guid": "d4c5f7fb",
336
+ "ForeignId": null,
337
+ "ForeignGuid": "e0432639",
338
+ "ForeignKey": null
339
+ },
340
+ {
341
+ "GroupRole": {
342
+ "IsSystem": true,
343
+ "GroupTypeId": 12345,
344
+ "Name": "Member",
345
+ "Description": null,
346
+ "Order": 0,
347
+ "MaxCount": null,
348
+ "MinCount": null,
349
+ "IsLeader": false,
350
+ "ReceiveRequirementsNotifications": false,
351
+ "CanView": false,
352
+ "CanEdit": false,
353
+ "CreatedDateTime": null,
354
+ "ModifiedDateTime": null,
355
+ "CreatedByPersonAliasId": null,
356
+ "ModifiedByPersonAliasId": null,
357
+ "Id": 1234,
358
+ "Guid": "38ee341a",
359
+ "ForeignId": null,
360
+ "ForeignGuid": null,
361
+ "ForeignKey": null
362
+ },
363
+ "IsSystem": false,
364
+ "GroupId": 1234,
365
+ "PersonId": 105335,
366
+ "GroupRoleId": 181,
367
+ "Note": null,
368
+ "GroupMemberStatus": 1,
369
+ "GuestCount": null,
370
+ "DateTimeAdded": "2017-11-12T14:05:37.88",
371
+ "IsNotified": false,
372
+ "CreatedDateTime": null,
373
+ "ModifiedDateTime": null,
374
+ "CreatedByPersonAliasId": null,
375
+ "ModifiedByPersonAliasId": null,
376
+ "Id": 442344,
377
+ "Guid": "9c951576",
378
+ "ForeignId": null,
379
+ "ForeignGuid": "9cb03f65",
380
+ "ForeignKey": null
381
+ },
382
+ {
383
+ "GroupRole": {
384
+ "IsSystem": true,
385
+ "GroupTypeId": 12345,
386
+ "Name": "Member",
387
+ "Description": null,
388
+ "Order": 0,
389
+ "MaxCount": null,
390
+ "MinCount": null,
391
+ "IsLeader": false,
392
+ "ReceiveRequirementsNotifications": false,
393
+ "CanView": false,
394
+ "CanEdit": false,
395
+ "CreatedDateTime": null,
396
+ "ModifiedDateTime": null,
397
+ "CreatedByPersonAliasId": null,
398
+ "ModifiedByPersonAliasId": null,
399
+ "Id": 1234,
400
+ "Guid": "38ee341a",
401
+ "ForeignId": null,
402
+ "ForeignGuid": null,
403
+ "ForeignKey": null
404
+ },
405
+ "IsSystem": false,
406
+ "GroupId": 1234,
407
+ "PersonId": 105336,
408
+ "GroupRoleId": 181,
409
+ "Note": null,
410
+ "GroupMemberStatus": 1,
411
+ "GuestCount": null,
412
+ "DateTimeAdded": "2017-11-12T14:05:30.003",
413
+ "IsNotified": false,
414
+ "CreatedDateTime": null,
415
+ "ModifiedDateTime": null,
416
+ "CreatedByPersonAliasId": null,
417
+ "ModifiedByPersonAliasId": null,
418
+ "Id": 442343,
419
+ "Guid": "5154400b",
420
+ "ForeignId": null,
421
+ "ForeignGuid": "f319fa05",
422
+ "ForeignKey": null
423
+ }
424
+ ],
425
+ "IsSystem": false,
426
+ "ParentGroupId": 123456,
427
+ "GroupTypeId": 12345,
428
+ "CampusId": null,
429
+ "ScheduleId": null,
430
+ "Name": "Some Group Name",
431
+ "Description": "",
432
+ "IsSecurityRole": false,
433
+ "IsActive": true,
434
+ "Order": 0,
435
+ "AllowGuests": null,
436
+ "WelcomeSystemEmailId": null,
437
+ "ExitSystemEmailId": null,
438
+ "SyncDataViewId": null,
439
+ "AddUserAccountsDuringSync": false,
440
+ "MustMeetRequirementsToAddMember": false,
441
+ "IsPublic": true,
442
+ "GroupCapacity": 20,
443
+ "RequiredSignatureDocumentTemplateId": null,
444
+ "CreatedDateTime": null,
445
+ "ModifiedDateTime": "2017-11-21T13:52:19.677",
446
+ "CreatedByPersonAliasId": null,
447
+ "ModifiedByPersonAliasId": 1122345,
448
+ "Id": 112233,
449
+ "Guid": "ed7ac06f",
450
+ "ForeignId": 44444,
451
+ "ForeignGuid": null,
452
+ "ForeignKey": "Group"
453
+ }
454
+ ]
@@ -0,0 +1,42 @@
1
+ [
2
+ {
3
+ "ParentLocationId": null,
4
+ "Name": "Some Location",
5
+ "IsActive": true,
6
+ "LocationTypeValueId": null,
7
+ "Street1": "123 Some St",
8
+ "Street2": "",
9
+ "City": "SomeCity",
10
+ "County": null,
11
+ "State": "HI",
12
+ "Country": "US",
13
+ "PostalCode": "12345-4532",
14
+ "Barcode": null,
15
+ "AssessorParcelId": null,
16
+ "StandardizeAttemptedDateTime": null,
17
+ "StandardizeAttemptedServiceType": null,
18
+ "StandardizeAttemptedResult": "0: Standardized",
19
+ "StandardizedDateTime": "2017-07-10T14:53:40.46",
20
+ "GeocodeAttemptedDateTime": null,
21
+ "GeocodeAttemptedServiceType": "smartystreets",
22
+ "GeocodeAttemptedResult": "3",
23
+ "GeocodedDateTime": "2017-07-10T14:56:22.337",
24
+ "IsGeoPointLocked": false,
25
+ "PrinterDeviceId": null,
26
+ "ImageId": null,
27
+ "SoftRoomThreshold": null,
28
+ "FirmRoomThreshold": null,
29
+ "Latitude": 42.96273,
30
+ "Longitude": -76.73045,
31
+ "Distance": 0,
32
+ "CreatedDateTime": "2017-07-10T14:53:40.46",
33
+ "ModifiedDateTime": "2017-07-10T14:53:40.46",
34
+ "CreatedByPersonAliasId": null,
35
+ "ModifiedByPersonAliasId": null,
36
+ "Id": 1234,
37
+ "Guid": "b92138f4-57a2-4401-8b46-2ddc2c581753",
38
+ "ForeignId": 1234578,
39
+ "ForeignGuid": null,
40
+ "ForeignKey": null
41
+ }
42
+ ]
@@ -0,0 +1,36 @@
1
+ [
2
+ {
3
+ "Id": 125,
4
+ "Name": "Simmons, Jim",
5
+ "IsActive": true,
6
+ "ImageHtmlTag": "<img src='/GetImage.ashx?id=475&maxwidth=50&maxheight=50'/>",
7
+ "Age": 35,
8
+ "FormattedAge": null,
9
+ "Gender": "Male",
10
+ "ConnectionStatus": "Member",
11
+ "RecordStatus": "Active",
12
+ "Email": "jim.simmons@fakeinbox.com",
13
+ "SpouseName": "Sarah Simmons",
14
+ "Address": "10828 N Biltmore Dr\r\nPhoenix, AZ 85029",
15
+ "PickerItemDetailsHtml": "\r\n<div class='picker-select-item-details clearfix' style='display: none;'>\r\n\t<div class='person-image' style='background-image:url(/GetImage.ashx?id=475&maxwidth=200&maxheight=200&width=65);background-size:cover;background-position:50%'></div>\r\n\t<div class='contents'>\r\n <div class='role'>Adult</div> <em class='age'>(35 yrs old)</em><p class='spouse'><strong>Spouse:</strong> Sarah Simmons</p><div class='address'><h5>Address</h5>10828 N Biltmore Dr<br/>Phoenix, AZ 85029</div><div class='margin-t-sm'><span class='email'>jim.simmons@fakeinbox.com</span><div class='phones'></div></div><p class='margin-t-sm'><small><a class='cursor-pointer' onclick=\"javascript: window.open('/person/125', '_blank', 'scrollbars=1,resizable=1,toolbar=1'); return false;\" data-toggle=\"tooltip\" title=\"View Profile\">View Profile</a></small></p>\r\n\t</div>\r\n</div>\r\n",
16
+ "PickerItemDetailsImageHtml": "<div class='person-image' style='background-image:url(/GetImage.ashx?id=475&maxwidth=200&maxheight=200&width=65);background-size:cover;background-position:50%'></div>",
17
+ "PickerItemDetailsPersonInfoHtml": "<div class='role'>Adult</div> <em class='age'>(35 yrs old)</em><p class='spouse'><strong>Spouse:</strong> Sarah Simmons</p><div class='address'><h5>Address</h5>10828 N Biltmore Dr<br/>Phoenix, AZ 85029</div><div class='margin-t-sm'><span class='email'>jim.simmons@fakeinbox.com</span><div class='phones'></div></div><p class='margin-t-sm'><small><a class='cursor-pointer' onclick=\"javascript: window.open('/person/125', '_blank', 'scrollbars=1,resizable=1,toolbar=1'); return false;\" data-toggle=\"tooltip\" title=\"View Profile\">View Profile</a></small></p>"
18
+ },
19
+ {
20
+ "Id": 126,
21
+ "Name": "Simmons, Sarah",
22
+ "IsActive": true,
23
+ "ImageHtmlTag": "<img src='/GetImage.ashx?id=476&maxwidth=50&maxheight=50'/>",
24
+ "Age": 34,
25
+ "FormattedAge": null,
26
+ "Gender": "Female",
27
+ "ConnectionStatus": "Member",
28
+ "RecordStatus": "Active",
29
+ "Email": "sarah.simmons@fakeinbox.com",
30
+ "SpouseName": "Jim Simmons",
31
+ "Address": "10828 N Biltmore Dr\r\nPhoenix, AZ 85029",
32
+ "PickerItemDetailsHtml": "\r\n<div class='picker-select-item-details clearfix' style='display: none;'>\r\n\t<div class='person-image' style='background-image:url(/GetImage.ashx?id=476&maxwidth=200&maxheight=200&width=65);background-size:cover;background-position:50%'></div>\r\n\t<div class='contents'>\r\n <div class='role'>Adult</div> <em class='age'>(34 yrs old)</em><p class='spouse'><strong>Spouse:</strong> Jim Simmons</p><div class='address'><h5>Address</h5>10828 N Biltmore Dr<br/>Phoenix, AZ 85029</div><div class='margin-t-sm'><span class='email'>sarah.simmons@fakeinbox.com</span><div class='phones'></div></div><p class='margin-t-sm'><small><a class='cursor-pointer' onclick=\"javascript: window.open('/person/126', '_blank', 'scrollbars=1,resizable=1,toolbar=1'); return false;\" data-toggle=\"tooltip\" title=\"View Profile\">View Profile</a></small></p>\r\n\t</div>\r\n</div>\r\n",
33
+ "PickerItemDetailsImageHtml": "<div class='person-image' style='background-image:url(/GetImage.ashx?id=476&maxwidth=200&maxheight=200&width=65);background-size:cover;background-position:50%'></div>",
34
+ "PickerItemDetailsPersonInfoHtml": "<div class='role'>Adult</div> <em class='age'>(34 yrs old)</em><p class='spouse'><strong>Spouse:</strong> Jim Simmons</p><div class='address'><h5>Address</h5>10828 N Biltmore Dr<br/>Phoenix, AZ 85029</div><div class='margin-t-sm'><span class='email'>sarah.simmons@fakeinbox.com</span><div class='phones'></div></div><p class='margin-t-sm'><small><a class='cursor-pointer' onclick=\"javascript: window.open('/person/126', '_blank', 'scrollbars=1,resizable=1,toolbar=1'); return false;\" data-toggle=\"tooltip\" title=\"View Profile\">View Profile</a></small></p>"
35
+ }
36
+ ]
@@ -0,0 +1,28 @@
1
+ [
2
+ {
3
+ "IsSystem": false,
4
+ "PersonId": 1234,
5
+ "CountryCode": "1",
6
+ "Number": "1234567890",
7
+ "NumberFormatted": "(123) 456-7890",
8
+ "Extension": "",
9
+ "NumberTypeValueId": 12,
10
+ "IsMessagingEnabled": false,
11
+ "IsUnlisted": false,
12
+ "Description": null,
13
+ "NumberTypeValue": null,
14
+ "NumberFormattedWithCountryCode": "+1 (123) 456-7890",
15
+ "CreatedDateTime": null,
16
+ "ModifiedDateTime": null,
17
+ "CreatedByPersonAliasId": null,
18
+ "ModifiedByPersonAliasId": null,
19
+ "ModifiedAuditValuesAlreadyUpdated": false,
20
+ "Attributes": null,
21
+ "AttributeValues": null,
22
+ "Id": 123456,
23
+ "Guid": "bc039a8e-f747-47aa-97f1-c6843b55f56b",
24
+ "ForeignId": null,
25
+ "ForeignGuid": "9db64a81-7af1-433f-84a5-3d55d383a288",
26
+ "ForeignKey": null
27
+ }
28
+ ]
@@ -0,0 +1,5 @@
1
+ class FixturesHelper
2
+ def self.read(path)
3
+ File.open(File.join(FIXTURES_DIR, path), 'rb').read
4
+ end
5
+ end
@@ -1,7 +1,40 @@
1
1
  require 'sinatra/base'
2
2
  require 'securerandom'
3
+ require_relative './fixtures_helper'
3
4
 
4
5
  class RockMock < Sinatra::Base
6
+ # DELETE requests
7
+ %w[
8
+ GroupMembers/:id
9
+ ].each do |end_point|
10
+ delete "/api/#{end_point}" do
11
+ content_type :json
12
+ status 204
13
+ end
14
+ end
15
+
16
+ # GET requests
17
+ {
18
+ families: 'Groups/GetFamilies/:id',
19
+ group: 'Groups/:id',
20
+ groups: 'Groups',
21
+ people_search: 'People/Search',
22
+ phone_numbers: 'PhoneNumbers'
23
+ }.each do |json, end_point|
24
+ get "/api/#{end_point}" do
25
+ json_response 200, "#{json}.json"
26
+ end
27
+ end
28
+
29
+ # POST requests
30
+ {
31
+ create_group_member: 'GroupMembers'
32
+ }.each do |json, end_point|
33
+ post "/api/#{end_point}" do
34
+ json_response 201, "#{json}.json"
35
+ end
36
+ end
37
+
5
38
  post '/api/Auth/Login' do
6
39
  content_type :json
7
40
 
@@ -20,4 +53,12 @@ class RockMock < Sinatra::Base
20
53
 
21
54
  status 204
22
55
  end
56
+
57
+ private
58
+
59
+ def json_response(response_code, file_name)
60
+ content_type :json
61
+ status response_code
62
+ FixturesHelper.read(file_name)
63
+ end
23
64
  end