smartwaiver-sdk 4.0.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,41 @@
1
+ dir = File.dirname(__FILE__)
2
+ require "#{dir}/../spec_helper"
3
+ require "#{dir}/../../lib/smartwaiver-sdk/keys_client"
4
+
5
+ describe SmartwaiverKeysClient do
6
+ attr_reader :client, :api_key
7
+
8
+ before do
9
+ FakeWeb.allow_net_connect = false
10
+ @api_key = "apikey"
11
+ @client = SmartwaiverKeysClient.new(@api_key)
12
+ end
13
+
14
+ describe "keys" do
15
+ it "#initialize" do
16
+ expect(@client).to be_kind_of(SmartwaiverKeysClient)
17
+ end
18
+
19
+ it "#create" do
20
+ label = 'Ruby SDK'
21
+
22
+ path="#{API_URL}/v4/keys/published"
23
+ FakeWeb.register_uri(:post, path, :body => json_keys_create_results)
24
+
25
+ response = @client.create(label)
26
+ expect(response[:published_keys][:newKey][:key]).to eq("SPoyAc7mNHK8L6Yaq2s2Bu8UMcBEoyTvDeizmj94p6")
27
+ expect(response[:published_keys][:newKey][:label]).to eq(label)
28
+ expect(response[:published_keys][:keys].length).to eq(1)
29
+ end
30
+
31
+ it "#list" do
32
+ path="#{API_URL}/v4/keys/published"
33
+ FakeWeb.register_uri(:get, path, :body => json_keys_list_results)
34
+
35
+ response = @client.list
36
+ expect(response[:published_keys][:keys].length).to eq(1)
37
+ expect(response[:published_keys][:keys][0][:key]).to eq("SPoyAc7mNHK8L6Yaq2s2Bu8UMcBEoyTvDeizmj94p6")
38
+ expect(response[:published_keys][:keys][0][:label]).to eq("Ruby SDK")
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,55 @@
1
+ dir = File.dirname(__FILE__)
2
+ require "#{dir}/../spec_helper"
3
+ require "#{dir}/../../lib/smartwaiver-sdk/search_client"
4
+
5
+ describe SmartwaiverSearchClient do
6
+ attr_reader :client, :api_key
7
+
8
+ before do
9
+ FakeWeb.allow_net_connect = false
10
+ @api_key = "apikey"
11
+ @client = SmartwaiverSearchClient.new(@api_key)
12
+ end
13
+
14
+ describe "keys" do
15
+ it "#initialize" do
16
+ expect(@client).to be_kind_of(SmartwaiverSearchClient)
17
+ end
18
+
19
+ it "#search empty" do
20
+ path="#{API_URL}/v4/search"
21
+ FakeWeb.register_uri(:get, path, :body => json_search_1_results)
22
+
23
+ response = @client.search()
24
+
25
+ expect(response[:search][:guid]).to eq("6jebdfxzvrdkd")
26
+ expect(response[:search][:count]).to eq(652)
27
+ expect(response[:search][:pages]).to eq(7)
28
+ expect(response[:search][:pageSize]).to eq(100)
29
+ end
30
+
31
+ it "#search all params" do
32
+ path="#{API_URL}/v4/search?templateId=xyz&fromDts=2018-01-01&toDts=2018-02-01&firstName=Rocky&lastName=RockChuck&verified=true&sort=asc&tag=new+customer"
33
+
34
+ FakeWeb.register_uri(:get, path, :body => json_search_1_results)
35
+
36
+ response = @client.search('xyz','2018-01-01', '2018-02-01','Rocky','RockChuck',true, SmartwaiverSearchClient::SEARCH_SORT_ASC, 'new customer')
37
+
38
+ expect(response[:search][:guid]).to eq("6jebdfxzvrdkd")
39
+ expect(response[:search][:count]).to eq(652)
40
+ expect(response[:search][:pages]).to eq(7)
41
+ expect(response[:search][:pageSize]).to eq(100)
42
+ end
43
+
44
+ it "#results" do
45
+
46
+ path="#{API_URL}/v4/search/6jebdfxzvrdkd/results?page=1"
47
+
48
+ FakeWeb.register_uri(:get, path, :body => json_search_2_results)
49
+
50
+ response = @client.results('6jebdfxzvrdkd', 1)
51
+ expect(response[:search_results].length).to eq(1)
52
+ end
53
+
54
+ end
55
+ end
@@ -0,0 +1,30 @@
1
+ dir = File.dirname(__FILE__)
2
+ require "#{dir}/../spec_helper"
3
+ require "#{dir}/../../lib/smartwaiver-sdk/user_client"
4
+
5
+ describe SmartwaiverUserClient do
6
+ attr_reader :client, :api_key
7
+
8
+ before do
9
+ FakeWeb.allow_net_connect = false
10
+ @api_key = "apikey"
11
+ @client = SmartwaiverUserClient.new(@api_key)
12
+ end
13
+
14
+ describe "user settings" do
15
+ it "#initialize" do
16
+ expect(@client).to be_kind_of(SmartwaiverUserClient)
17
+ end
18
+
19
+ it "#settings" do
20
+ path="#{API_URL}/v4/settings"
21
+ FakeWeb.register_uri(:get, path, :body => json_user_settings_results)
22
+
23
+ response = @client.settings()
24
+
25
+ expect(response[:settings][:console][:staticExpiration]).to eq("never")
26
+ expect(response[:settings][:console][:rollingExpiration]).to eq("never")
27
+ expect(response[:settings][:console][:rollingExpirationTime]).to eq("signed")
28
+ end
29
+ end
30
+ end
@@ -53,5 +53,39 @@ describe SmartwaiverWaiverClient do
53
53
  @client.get(waiver_id, true)
54
54
  end
55
55
 
56
+ it "#photos" do
57
+ waiver_id = "6jebdfxzvrdkd"
58
+ path = "#{API_URL}/v4/waivers/#{waiver_id}/photos"
59
+ FakeWeb.register_uri(:get, path, :body => json_waiver_photos_results)
60
+ result = @client.photos(waiver_id)
61
+
62
+ expect(result[:photos][:waiverId]).to eq(waiver_id)
63
+ expect(result[:photos][:templateId]).to eq("sprswrvh2keeh")
64
+ expect(result[:photos][:title]).to eq("Smartwaiver Demo Waiver")
65
+
66
+ expect(result[:photos][:photos].length).to eq(1)
67
+ expect(result[:photos][:photos][0][:type]).to eq("kiosk")
68
+ expect(result[:photos][:photos][0][:tag]).to eq("IP: 192.168.2.0")
69
+ expect(result[:photos][:photos][0][:fileType]).to eq("jpg")
70
+ expect(result[:photos][:photos][0][:photoId]).to eq("CwLeDjffgDoGHua")
71
+ expect(result[:photos][:photos][0][:photo]).to eq("BASE64 ENCODED PHOTO")
72
+ end
73
+
74
+ it "#signatures" do
75
+ waiver_id = "6jebdfxzvrdkd"
76
+ path = "#{API_URL}/v4/waivers/#{waiver_id}/signatures"
77
+ FakeWeb.register_uri(:get, path, :body => json_waiver_signatures_results)
78
+ result = @client.signatures(waiver_id)
79
+
80
+ expect(result[:signatures][:waiverId]).to eq(waiver_id)
81
+ expect(result[:signatures][:templateId]).to eq("sprswrvh2keeh")
82
+ expect(result[:signatures][:title]).to eq("Smartwaiver Demo Waiver")
83
+
84
+ expect(result[:signatures][:signatures][:participants].length).to eq(1)
85
+ expect(result[:signatures][:signatures][:guardian].length).to eq(1)
86
+ expect(result[:signatures][:signatures][:bodySignatures].length).to eq(1)
87
+ expect(result[:signatures][:signatures][:bodyInitials].length).to eq(1)
88
+ end
89
+
56
90
  end
57
91
  end
@@ -36,5 +36,22 @@ describe SmartwaiverWebhookClient do
36
36
  expect(response[:webhooks][:emailValidationRequired]).to eq(email_validation_required)
37
37
  end
38
38
 
39
+ it "#delete" do
40
+ path="#{API_URL}/v4/webhooks/configure"
41
+ FakeWeb.register_uri(:delete, path, :body => json_webhook_delete_results)
42
+
43
+ response = @client.delete
44
+
45
+ expect(response[:webhooks]).to eq({})
46
+ end
47
+
48
+ it "#resend" do
49
+ waiver_id = 'xyz'
50
+ path="#{API_URL}/v4/webhooks/resend/#{waiver_id}"
51
+ FakeWeb.register_uri(:put, path, :body => json_webhook_resend_results)
52
+
53
+ response = @client.resend(waiver_id)
54
+ expect(response[:webhooks_resend][:success]).to eq(true)
55
+ end
39
56
  end
40
57
  end
@@ -0,0 +1,75 @@
1
+ dir = File.dirname(__FILE__)
2
+ require "#{dir}/../spec_helper"
3
+ require "#{dir}/../../lib/smartwaiver-sdk/webhook_queues_client"
4
+
5
+ describe SmartwaiverWebhookQueuesClient do
6
+ attr_reader :client, :api_key
7
+
8
+ before do
9
+ FakeWeb.allow_net_connect = false
10
+ @api_key = "apikey"
11
+ @client = SmartwaiverWebhookQueuesClient.new(@api_key)
12
+ end
13
+
14
+ describe "webhook_queues" do
15
+ it "#initialize" do
16
+ expect(@client).to be_kind_of(SmartwaiverWebhookQueuesClient)
17
+ end
18
+
19
+ it "#information" do
20
+ path="#{API_URL}/v4/webhooks/queues"
21
+ FakeWeb.register_uri(:get, path, :body => json_webhook_queues_information_results)
22
+
23
+ response = @client.information
24
+ expect(response[:type]).to eq('api_webhook_all_queue_message_count')
25
+ expect(response[:api_webhook_all_queue_message_count][:account][:messagesTotal]).to eq(2)
26
+ expect(response[:api_webhook_all_queue_message_count][:'template-4fc7d12601941'][:messagesTotal]).to eq(4)
27
+ end
28
+
29
+ it "#get_message" do
30
+ path="#{API_URL}/v4/webhooks/queues/account"
31
+ FakeWeb.register_uri(:get, path, :body => json_webhook_queues_get_message_results)
32
+
33
+ response = @client.get_message
34
+ expect(response[:type]).to eq('api_webhook_account_message_get')
35
+ expect(response[:api_webhook_account_message_get][:messageId]).to eq('9d58e8fc-6353-4ceb-b0a3-5412f3d05e28')
36
+ expect(response[:api_webhook_account_message_get][:payload][:unique_id]).to eq('xyz')
37
+ expect(response[:api_webhook_account_message_get][:payload][:event]).to eq('new-waiver')
38
+ end
39
+
40
+ it "#delete_message" do
41
+ message_id = 'x-y-z'
42
+ path="#{API_URL}/v4/webhooks/queues/account/#{message_id}"
43
+ FakeWeb.register_uri(:delete, path, :body => json_webhook_queues_delete_message_results)
44
+
45
+ response = @client.delete_message(message_id)
46
+ expect(response[:type]).to eq('api_webhook_account_message_delete')
47
+ expect(response[:api_webhook_account_message_delete][:success]).to eq(true)
48
+ end
49
+
50
+ it "#get_template_message" do
51
+ template_id = 't1'
52
+ path="#{API_URL}/v4/webhooks/queues/template/#{template_id}"
53
+ FakeWeb.register_uri(:get, path, :body => json_webhook_queues_template_get_message_results)
54
+
55
+ response = @client.get_template_message(template_id)
56
+ expect(response[:type]).to eq('api_webhook_template_message_get')
57
+ expect(response[:api_webhook_template_message_get][:messageId]).to eq('9d58e8fc-6353-4ceb-b0a3-5412f3d05e28')
58
+ expect(response[:api_webhook_template_message_get][:payload][:unique_id]).to eq('xyz')
59
+ expect(response[:api_webhook_template_message_get][:payload][:event]).to eq('new-waiver')
60
+ end
61
+
62
+ it "#delete_template_message" do
63
+ template_id = 't1'
64
+ message_id = 'x-y-z'
65
+ path="#{API_URL}/v4/webhooks/queues/template/#{template_id}/#{message_id}"
66
+ FakeWeb.register_uri(:delete, path, :body => json_webhook_queues_template_delete_message_results)
67
+
68
+ response = @client.delete_template_message(template_id, message_id)
69
+
70
+ expect(response[:type]).to eq('api_webhook_template_message_delete')
71
+ expect(response[:api_webhook_template_message_delete][:success]).to eq(true)
72
+ end
73
+
74
+ end
75
+ end
data/spec/spec_helper.rb CHANGED
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  def json_api_version_results
19
19
  json = <<JAVASCRIPT
20
- {"version": "4.0.0"}
20
+ {"version": "4.2.0"}
21
21
  JAVASCRIPT
22
22
  json
23
23
  end
@@ -40,6 +40,106 @@ def json_webhook_configure_results
40
40
  JAVASCRIPT
41
41
  end
42
42
 
43
+ def json_webhook_delete_results
44
+ json = <<JAVASCRIPT
45
+ {"version":4, "id":"8e82fa534da14b76a05013644ee735d2", "ts":"2017-01-17T15:46:58+00:00", "type":"webhooks", "webhooks":{}}
46
+ JAVASCRIPT
47
+ end
48
+
49
+ def json_webhook_resend_results
50
+ json = <<JAVASCRIPT
51
+ {"version":4, "id":"8e82fa534da14b76a05013644ee735d2", "ts":"2017-01-17T15:46:58+00:00", "type":"webhooks_resend", "webhooks_resend":{"success":true}}
52
+ JAVASCRIPT
53
+ end
54
+
55
+
56
+
57
+ def json_webhook_queues_information_results
58
+ json = <<JAVASCRIPT
59
+ {
60
+ "version" : 4,
61
+ "id" : "a0256461ca244278b412ab3238f5efd2",
62
+ "ts" : "2017-01-24T11:14:25+00:00",
63
+ "type" : "api_webhook_all_queue_message_count",
64
+ "api_webhook_all_queue_message_count" : {
65
+ "account": {
66
+ "messagesTotal": 2,
67
+ "messagesNotVisible": 0,
68
+ "messagesDelayed": 0
69
+ },
70
+ "template-4fc7d12601941": {
71
+ "messagesTotal": 4,
72
+ "messagesNotVisible": 2,
73
+ "messagesDelayed": 0
74
+ }
75
+ }
76
+ }
77
+ JAVASCRIPT
78
+ end
79
+
80
+ def json_webhook_queues_get_message_results
81
+ json = <<JAVASCRIPT
82
+ {
83
+ "version" : 4,
84
+ "id" : "a0256461ca244278b412ab3238f5efd2",
85
+ "ts" : "2017-01-24T11:14:25+00:00",
86
+ "type" : "api_webhook_account_message_get",
87
+ "api_webhook_account_message_get" : {
88
+ "messageId": "9d58e8fc-6353-4ceb-b0a3-5412f3d05e28",
89
+ "payload": {
90
+ "unique_id": "xyz",
91
+ "event": "new-waiver"
92
+ }
93
+ }
94
+ }
95
+ JAVASCRIPT
96
+ end
97
+
98
+ def json_webhook_queues_delete_message_results
99
+ json = <<JAVASCRIPT
100
+ {
101
+ "version" : 4,
102
+ "id" : "a0256461ca244278b412ab3238f5efd2",
103
+ "ts" : "2017-01-24T11:14:25+00:00",
104
+ "type" : "api_webhook_account_message_delete",
105
+ "api_webhook_account_message_delete" : {
106
+ "success": true
107
+ }
108
+ }
109
+ JAVASCRIPT
110
+ end
111
+
112
+ def json_webhook_queues_template_get_message_results
113
+ json = <<JAVASCRIPT
114
+ {
115
+ "version" : 4,
116
+ "id" : "a0256461ca244278b412ab3238f5efd2",
117
+ "ts" : "2017-01-24T11:14:25+00:00",
118
+ "type" : "api_webhook_template_message_get",
119
+ "api_webhook_template_message_get" : {
120
+ "messageId": "9d58e8fc-6353-4ceb-b0a3-5412f3d05e28",
121
+ "payload": {
122
+ "unique_id": "xyz",
123
+ "event": "new-waiver"
124
+ }
125
+ }
126
+ }
127
+ JAVASCRIPT
128
+ end
129
+
130
+ def json_webhook_queues_template_delete_message_results
131
+ json = <<JAVASCRIPT
132
+ {
133
+ "version" : 4,
134
+ "id" : "a0256461ca244278b412ab3238f5efd2",
135
+ "ts" : "2017-01-24T11:14:25+00:00",
136
+ "type" : "api_webhook_template_message_delete",
137
+ "api_webhook_template_message_delete" : {
138
+ "success": true
139
+ }
140
+ }
141
+ JAVASCRIPT
142
+ end
43
143
 
44
144
  def json_template_list_results
45
145
  json = <<JAVASCRIPT
@@ -127,3 +227,235 @@ def json_waiver_single_results
127
227
  }
128
228
  JAVASCRIPT
129
229
  end
230
+
231
+ def json_waiver_photos_results
232
+ json = <<JAVASCRIPT
233
+ {
234
+ "version" : 4,
235
+ "id" : "a0256461ca244278b412ab3238f5efd2",
236
+ "ts" : "2017-01-24T11:14:25+00:00",
237
+ "type" : "photos",
238
+ "photos" : {
239
+ "waiverId": "6jebdfxzvrdkd",
240
+ "templateId": "sprswrvh2keeh",
241
+ "title": "Smartwaiver Demo Waiver",
242
+ "createdOn": "2017-01-24 13:12:29",
243
+ "photos": [
244
+ {
245
+ "type": "kiosk",
246
+ "date": "2017-01-01 00:00:00",
247
+ "tag": "IP: 192.168.2.0",
248
+ "fileType": "jpg",
249
+ "photoId": "CwLeDjffgDoGHua",
250
+ "photo": "BASE64 ENCODED PHOTO"
251
+ }
252
+ ]
253
+ }
254
+ }
255
+ JAVASCRIPT
256
+ json
257
+ end
258
+
259
+ def json_waiver_signatures_results
260
+ json = <<JAVASCRIPT
261
+ {
262
+ "version" : 4,
263
+ "id" : "a0256461ca244278b412ab3238f5efd2",
264
+ "ts" : "2017-01-24T11:14:25+00:00",
265
+ "type" : "signatures",
266
+ "signatures" : {
267
+ "waiverId": "6jebdfxzvrdkd",
268
+ "templateId": "sprswrvh2keeh",
269
+ "title": "Smartwaiver Demo Waiver",
270
+ "createdOn": "2017-01-24 13:12:29",
271
+ "signatures": {
272
+ "participants": [
273
+ "BASE64 ENCODED IMAGE STRING"
274
+ ],
275
+ "guardian": [
276
+ "BASE64 ENCODED IMAGE STRING"
277
+ ],
278
+ "bodySignatures": [
279
+ "BASE64 ENCODED IMAGE STRING"
280
+ ],
281
+ "bodyInitials": [
282
+ "BASE64 ENCODED IMAGE STRING"
283
+ ]
284
+ }
285
+ }
286
+ }
287
+ JAVASCRIPT
288
+ json
289
+ end
290
+
291
+
292
+ def json_dynamic_template_default
293
+ '{"template":{"meta":{},"header":{},"body":{},"participants":{"adults":true},"standardQuestions":{},"guardian":{},"electronicConsent":{},"styling":{},"completion":{},"signatures":{},"processing":{}},"data":{"adult":true,"participants":[],"guardian":{"participant":false}}}'
294
+ end
295
+
296
+ def json_keys_create_results
297
+ json = <<JAVASCRIPT
298
+ {"version" : 4,"id" : "a0256461ca244278b412ab3238f5efd2","ts" : "2017-01-24T11:14:25+00:00","type" : "published_keys",
299
+ "published_keys" : {
300
+ "newKey": {
301
+ "createdAt": "2017-01-24T11:14:25Z",
302
+ "key" : "SPoyAc7mNHK8L6Yaq2s2Bu8UMcBEoyTvDeizmj94p6",
303
+ "label" : "Ruby SDK"
304
+ },
305
+ "keys" : [
306
+ {
307
+ "createdAt": "2017-01-24T11:14:25Z",
308
+ "key" : "SPoyAc7mNHK8L6Yaq2s2Bu8UMcBEoyTvDeizmj94p6",
309
+ "label" : "demo"
310
+ }
311
+ ]
312
+ }
313
+ }
314
+ JAVASCRIPT
315
+ json
316
+ end
317
+
318
+ def json_keys_list_results
319
+ json = <<JAVASCRIPT
320
+ {
321
+ "version" : 4,"id" : "a0256461ca244278b412ab3238f5efd2","ts" : "2017-01-24T11:14:25Z","type" : "published_keys",
322
+ "published_keys" : {
323
+ "keys" : [
324
+ {
325
+ "createdAt": "2017-01-24T11:14:25Z",
326
+ "key" : "SPoyAc7mNHK8L6Yaq2s2Bu8UMcBEoyTvDeizmj94p6",
327
+ "label" : "Ruby SDK"
328
+ }
329
+ ]
330
+ }
331
+ }
332
+ JAVASCRIPT
333
+ json
334
+ end
335
+
336
+ def json_search_1_results
337
+ json = <<JAVASCRIPT
338
+ {
339
+ "version" : 4,
340
+ "id" : "a0256461ca244278b412ab3238f5efd2",
341
+ "ts" : "2017-01-24T11:14:25+00:00",
342
+ "type" : "search",
343
+ "search" : {
344
+ "guid": "6jebdfxzvrdkd",
345
+ "count": 652,
346
+ "pages": 7,
347
+ "pageSize": 100
348
+ }
349
+ }
350
+ JAVASCRIPT
351
+ json
352
+ end
353
+
354
+ def json_search_2_results
355
+ json = <<JAVASCRIPT
356
+ {
357
+ "version" : 4,
358
+ "id" : "a0256461ca244278b412ab3238f5efd2",
359
+ "ts" : "2017-01-24T11:14:25+00:00",
360
+ "type" : "search_results",
361
+ "search_results" : [
362
+ {
363
+ "waiverId": "6jebdfxzvrdkd",
364
+ "templateId": "sprswrvh2keeh",
365
+ "title": "Smartwaiver Demo Waiver",
366
+ "createdOn": "2017-01-24 13:12:29",
367
+ "expirationDate": "",
368
+ "expired": false,
369
+ "verified": true,
370
+ "kiosk": true,
371
+ "firstName": "Kyle",
372
+ "middleName": "",
373
+ "lastName": "Smith II",
374
+ "dob": "2008-12-25",
375
+ "clientIP": "192.0.2.0",
376
+ "email":"example@smartwaiver.com",
377
+ "marketingAllowed": false,
378
+ "addressLineOne": "626 NW Arizona Ave.",
379
+ "addressLineTwo": "Suite 2",
380
+ "addressCity": "Bend",
381
+ "addressState": "OR",
382
+ "addressZip": "97703",
383
+ "addressCountry": "US",
384
+ "emergencyContactName": "Mary Smith",
385
+ "emergencyContactPhone": "111-111-1111",
386
+ "insuranceCarrier": "My Insurance",
387
+ "insurancePolicyNumber": "1234567",
388
+ "driversLicenseNumber": "9876543",
389
+ "driversLicenseState": "OR",
390
+ "tags": [
391
+ "Green Team"
392
+ ],
393
+ "flags": {
394
+ "displayText": "Have you received our orientation?",
395
+ "reason": "was not selected"
396
+ },
397
+ "participants": [
398
+ {
399
+ "firstName": "Kyle",
400
+ "middleName": "",
401
+ "lastName": "Smith II",
402
+ "dob": "2008-12-25",
403
+ "isMinor": true,
404
+ "gender": "Male",
405
+ "phone": "",
406
+ "tags": ["YES"],
407
+ "customParticipantFields" : {
408
+ "bk3xydss4e9dy" : {
409
+ "value" : "YES",
410
+ "displayText" : "Is this participant ready to have fun?"
411
+ }
412
+ },
413
+ "flags": [
414
+ {
415
+ "displayText": "Are you excited?",
416
+ "reason": "was not selected"
417
+ }
418
+ ]
419
+ }
420
+ ],
421
+ "pdf": "Base64 Encoded PDF",
422
+ "photos": 1,
423
+ "guardian": {
424
+ "firstName": "Kyle",
425
+ "middleName": "",
426
+ "lastName": "Smith I",
427
+ "phone": "555-555-5555",
428
+ "dob": "1970-12-25"
429
+ },
430
+ "customWaiverFields" : {
431
+ "ha5bs1jy5wdop" : {
432
+ "value" : "A friend",
433
+ "displayText" : "How did you hear about Smartwaiver?"
434
+ }
435
+ }
436
+ }
437
+ ]
438
+ }
439
+ JAVASCRIPT
440
+ json
441
+ end
442
+
443
+ def json_user_settings_results
444
+ json = <<JAVASCRIPT
445
+ {
446
+ "version" : 4,
447
+ "id" : "a0256461ca244278b412ab3238f5efd2",
448
+ "ts" : "2017-01-24T11:14:25Z",
449
+ "type" : "settings",
450
+ "settings" : {
451
+ "console" : {
452
+ "staticExpiration" : "never",
453
+ "rollingExpiration" : "never",
454
+ "rollingExpirationTime" : "signed"
455
+ }
456
+ }
457
+ }
458
+ JAVASCRIPT
459
+ json
460
+ end
461
+