poptart 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/poptart/model.rb +11 -13
- data/lib/poptart/range_question.rb +1 -1
- data/lib/poptart/survey.rb +1 -2
- data/lib/poptart/survey_question.rb +8 -3
- data/lib/poptart/time_question.rb +9 -0
- data/lib/poptart/user.rb +3 -1
- data/lib/poptart.rb +1 -0
- data/lib/version.rb +1 -1
- data/spec/requests/answering_survey_questions_spec.rb +3 -27
- data/spec/requests/answers_spec.rb +11 -13
- data/spec/requests/user_management_spec.rb +0 -2
- data/spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml +6606 -3251
- data/spec/vcr/answering/survey_questions_answers_a_survey_question.yml +18354 -6356
- data/spec/vcr/answering/survey_questions_creates_and_returns_a_random_question_survey.yml +1223 -387
- data/spec/vcr/answering/survey_questions_creates_and_returns_an_empty_survey.yml +331 -183
- data/spec/vcr/answering/survey_questions_finds_survey_question_for_id.yml +1475 -403
- data/spec/vcr/creating/quesitons_returns_boolean_question.yml +66 -0
- data/spec/vcr/creating/quesitons_returns_multiple_question.yml +90 -21
- data/spec/vcr/creating/quesitons_returns_range_question.yml +92 -23
- data/spec/vcr/retrieving/answers_returns_all_answered_survey_questions_for_a_question.yml +7543 -0
- data/spec/vcr/retrieving/answers_returns_answers.yml +1956 -84
- data/spec/vcr/user/management_creates_a_user.yml +26 -27
- data/spec/vcr/user/management_returns_a_user.yml +186 -63
- metadata +5 -4
- data/spec/requests/root_spec.rb +0 -11
@@ -71,10 +71,10 @@ http_interactions:
|
|
71
71
|
recorded_at: Sat, 05 Jul 2014 20:53:45 GMT
|
72
72
|
- request:
|
73
73
|
method: post
|
74
|
-
uri: http://localhost:3000/api/users
|
74
|
+
uri: http://localhost:3000/api/users/
|
75
75
|
body:
|
76
76
|
encoding: UTF-8
|
77
|
-
string:
|
77
|
+
string: "{}"
|
78
78
|
headers:
|
79
79
|
User-Agent:
|
80
80
|
- Faraday v0.9.0
|
@@ -102,39 +102,39 @@ http_interactions:
|
|
102
102
|
Content-Type:
|
103
103
|
- application/json; charset=utf-8
|
104
104
|
Etag:
|
105
|
-
- '"
|
105
|
+
- '"903006ae2ce12ab6070ee76670a487bb"'
|
106
106
|
Cache-Control:
|
107
107
|
- max-age=0, private, must-revalidate
|
108
108
|
X-Request-Id:
|
109
|
-
-
|
109
|
+
- 5bcdbb1e-8c13-46f0-aab2-482c64577c0e
|
110
110
|
X-Runtime:
|
111
|
-
- '0.
|
111
|
+
- '0.006907'
|
112
112
|
Server:
|
113
113
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
114
114
|
Date:
|
115
|
-
- Sat,
|
115
|
+
- Sat, 20 Sep 2014 14:14:34 GMT
|
116
116
|
Content-Length:
|
117
|
-
- '
|
117
|
+
- '272'
|
118
118
|
Connection:
|
119
119
|
- Keep-Alive
|
120
120
|
body:
|
121
121
|
encoding: UTF-8
|
122
122
|
string: |-
|
123
123
|
{
|
124
|
-
"id":
|
125
|
-
"
|
126
|
-
"
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
"
|
124
|
+
"id": 13,
|
125
|
+
"service_user_id": "3aa49be2db36a85fe4c6b19e6345c8379836716ee035c972e748c7c71195864c",
|
126
|
+
"_links": {
|
127
|
+
"self": {
|
128
|
+
"href": "http://localhost:3000/api/users/13"
|
129
|
+
}
|
130
|
+
},
|
131
|
+
"token": "2965f424f516ad23160aecf4bb6c9131c31439a129a976981237b1b0fbd8754b"
|
132
132
|
}
|
133
133
|
http_version:
|
134
|
-
recorded_at: Sat,
|
134
|
+
recorded_at: Sat, 20 Sep 2014 14:14:34 GMT
|
135
135
|
- request:
|
136
136
|
method: post
|
137
|
-
uri: http://localhost:3000/api/users
|
137
|
+
uri: http://localhost:3000/api/users
|
138
138
|
body:
|
139
139
|
encoding: UTF-8
|
140
140
|
string: "{}"
|
@@ -165,34 +165,33 @@ http_interactions:
|
|
165
165
|
Content-Type:
|
166
166
|
- application/json; charset=utf-8
|
167
167
|
Etag:
|
168
|
-
- '"
|
168
|
+
- '"c19dca84f25b0b3148d9b9fd598c818f"'
|
169
169
|
Cache-Control:
|
170
170
|
- max-age=0, private, must-revalidate
|
171
171
|
X-Request-Id:
|
172
|
-
-
|
172
|
+
- 61958a0d-6247-42a1-9046-78a7330c95e1
|
173
173
|
X-Runtime:
|
174
|
-
- '0.
|
174
|
+
- '0.009018'
|
175
175
|
Server:
|
176
176
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
177
177
|
Date:
|
178
|
-
-
|
178
|
+
- Sun, 05 Oct 2014 12:56:55 GMT
|
179
179
|
Content-Length:
|
180
|
-
- '
|
180
|
+
- '261'
|
181
181
|
Connection:
|
182
182
|
- Keep-Alive
|
183
183
|
body:
|
184
184
|
encoding: UTF-8
|
185
185
|
string: |-
|
186
186
|
{
|
187
|
-
"
|
188
|
-
"service_user_id": "3aa49be2db36a85fe4c6b19e6345c8379836716ee035c972e748c7c71195864c",
|
187
|
+
"service_user_id": "6636fecbce7c6e772ee47a4ccf75a48dbbd5f773eed970554b0ed96e6a4e6f70",
|
189
188
|
"_links": {
|
190
189
|
"self": {
|
191
|
-
"href": "http://localhost:3000/api/users/
|
190
|
+
"href": "http://localhost:3000/api/users/211"
|
192
191
|
}
|
193
192
|
},
|
194
|
-
"token": "
|
193
|
+
"token": "0ba0d61be9303076a3c8e381eaf4d3b63541fe8c5c6a86a3df69d437783acf8e"
|
195
194
|
}
|
196
195
|
http_version:
|
197
|
-
recorded_at:
|
196
|
+
recorded_at: Sun, 05 Oct 2014 12:56:55 GMT
|
198
197
|
recorded_with: VCR 2.6.0
|
@@ -69,69 +69,6 @@ http_interactions:
|
|
69
69
|
}
|
70
70
|
http_version:
|
71
71
|
recorded_at: Sat, 05 Jul 2014 20:53:45 GMT
|
72
|
-
- request:
|
73
|
-
method: post
|
74
|
-
uri: http://localhost:3000/api/users
|
75
|
-
body:
|
76
|
-
encoding: UTF-8
|
77
|
-
string: '{"user":{"external_user_id":43}}'
|
78
|
-
headers:
|
79
|
-
User-Agent:
|
80
|
-
- Faraday v0.9.0
|
81
|
-
Content-Type:
|
82
|
-
- application/json
|
83
|
-
Api-Token:
|
84
|
-
- testing
|
85
|
-
Accept-Encoding:
|
86
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
87
|
-
Accept:
|
88
|
-
- "*/*"
|
89
|
-
response:
|
90
|
-
status:
|
91
|
-
code: 201
|
92
|
-
message: 'Created '
|
93
|
-
headers:
|
94
|
-
X-Frame-Options:
|
95
|
-
- SAMEORIGIN
|
96
|
-
X-Xss-Protection:
|
97
|
-
- 1; mode=block
|
98
|
-
X-Content-Type-Options:
|
99
|
-
- nosniff
|
100
|
-
X-Ua-Compatible:
|
101
|
-
- chrome=1
|
102
|
-
Content-Type:
|
103
|
-
- application/json; charset=utf-8
|
104
|
-
Etag:
|
105
|
-
- '"a97ffbe2de4c35a2b0700216029737e1"'
|
106
|
-
Cache-Control:
|
107
|
-
- max-age=0, private, must-revalidate
|
108
|
-
X-Request-Id:
|
109
|
-
- 910605aa-fb88-41bc-93cd-5e38675251e3
|
110
|
-
X-Runtime:
|
111
|
-
- '0.008499'
|
112
|
-
Server:
|
113
|
-
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
114
|
-
Date:
|
115
|
-
- Sat, 05 Jul 2014 20:53:45 GMT
|
116
|
-
Content-Length:
|
117
|
-
- '398'
|
118
|
-
Connection:
|
119
|
-
- Keep-Alive
|
120
|
-
body:
|
121
|
-
encoding: UTF-8
|
122
|
-
string: |-
|
123
|
-
{
|
124
|
-
"id": 257,
|
125
|
-
"first_name": null,
|
126
|
-
"last_name": null,
|
127
|
-
"api_token": "b5e1645f407f56abf047dc0604d89bb0bf159113401166cb3f997a57c4bff42e",
|
128
|
-
"created_at": "2014-07-05T20:53:45.942Z",
|
129
|
-
"updated_at": "2014-07-05T20:53:45.942Z",
|
130
|
-
"token": "ffbe8dd1740492dbb48e5b82483e2193c8c1ae7a8b21c05f437933c835d8ae47f53a6bf0b425f2d87e9d30d3712f38c4df7832c74b6b85f3c46ada4a691cb048",
|
131
|
-
"external_user_id": 43
|
132
|
-
}
|
133
|
-
http_version:
|
134
|
-
recorded_at: Sat, 05 Jul 2014 20:53:45 GMT
|
135
72
|
- request:
|
136
73
|
method: get
|
137
74
|
uri: http://localhost:3000/
|
@@ -451,4 +388,190 @@ http_interactions:
|
|
451
388
|
}
|
452
389
|
http_version:
|
453
390
|
recorded_at: Sat, 20 Sep 2014 14:14:34 GMT
|
391
|
+
- request:
|
392
|
+
method: get
|
393
|
+
uri: http://localhost:3000/api/users/2002cd7297df71bbaccd578e434df62cefbb5f96bfb654b6a28efed0dc652e1c
|
394
|
+
body:
|
395
|
+
encoding: US-ASCII
|
396
|
+
string: ''
|
397
|
+
headers:
|
398
|
+
User-Agent:
|
399
|
+
- Faraday v0.9.0
|
400
|
+
Content-Type:
|
401
|
+
- application/json
|
402
|
+
Api-Token:
|
403
|
+
- testing
|
404
|
+
Accept-Encoding:
|
405
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
406
|
+
Accept:
|
407
|
+
- "*/*"
|
408
|
+
response:
|
409
|
+
status:
|
410
|
+
code: 200
|
411
|
+
message: 'OK '
|
412
|
+
headers:
|
413
|
+
X-Frame-Options:
|
414
|
+
- SAMEORIGIN
|
415
|
+
X-Xss-Protection:
|
416
|
+
- 1; mode=block
|
417
|
+
X-Content-Type-Options:
|
418
|
+
- nosniff
|
419
|
+
X-Ua-Compatible:
|
420
|
+
- chrome=1
|
421
|
+
Content-Type:
|
422
|
+
- application/json; charset=utf-8
|
423
|
+
Etag:
|
424
|
+
- '"e39fb766a291e564616c961f36f7cca1"'
|
425
|
+
Cache-Control:
|
426
|
+
- max-age=0, private, must-revalidate
|
427
|
+
X-Request-Id:
|
428
|
+
- 00ac391e-1b0d-4f63-a04d-18e51dd3f5d3
|
429
|
+
X-Runtime:
|
430
|
+
- '0.006644'
|
431
|
+
Server:
|
432
|
+
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
433
|
+
Date:
|
434
|
+
- Sun, 05 Oct 2014 12:55:49 GMT
|
435
|
+
Content-Length:
|
436
|
+
- '261'
|
437
|
+
Connection:
|
438
|
+
- Keep-Alive
|
439
|
+
body:
|
440
|
+
encoding: UTF-8
|
441
|
+
string: |-
|
442
|
+
{
|
443
|
+
"service_user_id": "2002cd7297df71bbaccd578e434df62cefbb5f96bfb654b6a28efed0dc652e1c",
|
444
|
+
"_links": {
|
445
|
+
"self": {
|
446
|
+
"href": "http://localhost:3000/api/users/209"
|
447
|
+
}
|
448
|
+
},
|
449
|
+
"token": "b278d1476d83e5d03fa063a81190b21a1c8705cb7b1e2a7d29b8b367e9b1c24e"
|
450
|
+
}
|
451
|
+
http_version:
|
452
|
+
recorded_at: Sun, 05 Oct 2014 12:55:49 GMT
|
453
|
+
- request:
|
454
|
+
method: post
|
455
|
+
uri: http://localhost:3000/api/users
|
456
|
+
body:
|
457
|
+
encoding: UTF-8
|
458
|
+
string: "{}"
|
459
|
+
headers:
|
460
|
+
User-Agent:
|
461
|
+
- Faraday v0.9.0
|
462
|
+
Content-Type:
|
463
|
+
- application/json
|
464
|
+
Api-Token:
|
465
|
+
- testing
|
466
|
+
Accept-Encoding:
|
467
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
468
|
+
Accept:
|
469
|
+
- "*/*"
|
470
|
+
response:
|
471
|
+
status:
|
472
|
+
code: 201
|
473
|
+
message: 'Created '
|
474
|
+
headers:
|
475
|
+
X-Frame-Options:
|
476
|
+
- SAMEORIGIN
|
477
|
+
X-Xss-Protection:
|
478
|
+
- 1; mode=block
|
479
|
+
X-Content-Type-Options:
|
480
|
+
- nosniff
|
481
|
+
X-Ua-Compatible:
|
482
|
+
- chrome=1
|
483
|
+
Content-Type:
|
484
|
+
- application/json; charset=utf-8
|
485
|
+
Etag:
|
486
|
+
- '"203b04ee2677eb52b616b7689ebdd141"'
|
487
|
+
Cache-Control:
|
488
|
+
- max-age=0, private, must-revalidate
|
489
|
+
X-Request-Id:
|
490
|
+
- 1ef35a2b-571d-4435-95e2-af69c72ccf43
|
491
|
+
X-Runtime:
|
492
|
+
- '0.007209'
|
493
|
+
Server:
|
494
|
+
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
495
|
+
Date:
|
496
|
+
- Sun, 05 Oct 2014 12:56:55 GMT
|
497
|
+
Content-Length:
|
498
|
+
- '261'
|
499
|
+
Connection:
|
500
|
+
- Keep-Alive
|
501
|
+
body:
|
502
|
+
encoding: UTF-8
|
503
|
+
string: |-
|
504
|
+
{
|
505
|
+
"service_user_id": "6636fecbce7c6e772ee47a4ccf75a48dbbd5f773eed970554b0ed96e6a4e6f70",
|
506
|
+
"_links": {
|
507
|
+
"self": {
|
508
|
+
"href": "http://localhost:3000/api/users/212"
|
509
|
+
}
|
510
|
+
},
|
511
|
+
"token": "0ba0d61be9303076a3c8e381eaf4d3b63541fe8c5c6a86a3df69d437783acf8e"
|
512
|
+
}
|
513
|
+
http_version:
|
514
|
+
recorded_at: Sun, 05 Oct 2014 12:56:55 GMT
|
515
|
+
- request:
|
516
|
+
method: get
|
517
|
+
uri: http://localhost:3000/api/users/6636fecbce7c6e772ee47a4ccf75a48dbbd5f773eed970554b0ed96e6a4e6f70
|
518
|
+
body:
|
519
|
+
encoding: US-ASCII
|
520
|
+
string: ''
|
521
|
+
headers:
|
522
|
+
User-Agent:
|
523
|
+
- Faraday v0.9.0
|
524
|
+
Content-Type:
|
525
|
+
- application/json
|
526
|
+
Api-Token:
|
527
|
+
- testing
|
528
|
+
Accept-Encoding:
|
529
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
530
|
+
Accept:
|
531
|
+
- "*/*"
|
532
|
+
response:
|
533
|
+
status:
|
534
|
+
code: 200
|
535
|
+
message: 'OK '
|
536
|
+
headers:
|
537
|
+
X-Frame-Options:
|
538
|
+
- SAMEORIGIN
|
539
|
+
X-Xss-Protection:
|
540
|
+
- 1; mode=block
|
541
|
+
X-Content-Type-Options:
|
542
|
+
- nosniff
|
543
|
+
X-Ua-Compatible:
|
544
|
+
- chrome=1
|
545
|
+
Content-Type:
|
546
|
+
- application/json; charset=utf-8
|
547
|
+
Etag:
|
548
|
+
- '"c19dca84f25b0b3148d9b9fd598c818f"'
|
549
|
+
Cache-Control:
|
550
|
+
- max-age=0, private, must-revalidate
|
551
|
+
X-Request-Id:
|
552
|
+
- 60ba66f4-4ea5-4cfd-8d15-f40c180b7e1f
|
553
|
+
X-Runtime:
|
554
|
+
- '0.007054'
|
555
|
+
Server:
|
556
|
+
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
557
|
+
Date:
|
558
|
+
- Sun, 05 Oct 2014 12:56:55 GMT
|
559
|
+
Content-Length:
|
560
|
+
- '261'
|
561
|
+
Connection:
|
562
|
+
- Keep-Alive
|
563
|
+
body:
|
564
|
+
encoding: UTF-8
|
565
|
+
string: |-
|
566
|
+
{
|
567
|
+
"service_user_id": "6636fecbce7c6e772ee47a4ccf75a48dbbd5f773eed970554b0ed96e6a4e6f70",
|
568
|
+
"_links": {
|
569
|
+
"self": {
|
570
|
+
"href": "http://localhost:3000/api/users/211"
|
571
|
+
}
|
572
|
+
},
|
573
|
+
"token": "0ba0d61be9303076a3c8e381eaf4d3b63541fe8c5c6a86a3df69d437783acf8e"
|
574
|
+
}
|
575
|
+
http_version:
|
576
|
+
recorded_at: Sun, 05 Oct 2014 12:56:55 GMT
|
454
577
|
recorded_with: VCR 2.6.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poptart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austen Ito
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -218,13 +218,13 @@ files:
|
|
218
218
|
- lib/poptart/root.rb
|
219
219
|
- lib/poptart/survey.rb
|
220
220
|
- lib/poptart/survey_question.rb
|
221
|
+
- lib/poptart/time_question.rb
|
221
222
|
- lib/poptart/user.rb
|
222
223
|
- lib/version.rb
|
223
224
|
- poptart.gemspec
|
224
225
|
- spec/requests/answering_survey_questions_spec.rb
|
225
226
|
- spec/requests/answers_spec.rb
|
226
227
|
- spec/requests/creating_questions_spec.rb
|
227
|
-
- spec/requests/root_spec.rb
|
228
228
|
- spec/requests/user_management_spec.rb
|
229
229
|
- spec/spec_helper.rb
|
230
230
|
- spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml
|
@@ -239,6 +239,7 @@ files:
|
|
239
239
|
- spec/vcr/poptart/root/builds_top_level_uri.yml
|
240
240
|
- spec/vcr/poptart/root/builds_urls.yml
|
241
241
|
- spec/vcr/poptart/root/returns_survey_links.yml
|
242
|
+
- spec/vcr/retrieving/answers_returns_all_answered_survey_questions_for_a_question.yml
|
242
243
|
- spec/vcr/retrieving/answers_returns_answers.yml
|
243
244
|
- spec/vcr/retrieving/responses_returns_responses.yml
|
244
245
|
- spec/vcr/user/management_creates_a_user.yml
|
@@ -272,7 +273,6 @@ test_files:
|
|
272
273
|
- spec/requests/answering_survey_questions_spec.rb
|
273
274
|
- spec/requests/answers_spec.rb
|
274
275
|
- spec/requests/creating_questions_spec.rb
|
275
|
-
- spec/requests/root_spec.rb
|
276
276
|
- spec/requests/user_management_spec.rb
|
277
277
|
- spec/spec_helper.rb
|
278
278
|
- spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml
|
@@ -287,6 +287,7 @@ test_files:
|
|
287
287
|
- spec/vcr/poptart/root/builds_top_level_uri.yml
|
288
288
|
- spec/vcr/poptart/root/builds_urls.yml
|
289
289
|
- spec/vcr/poptart/root/returns_survey_links.yml
|
290
|
+
- spec/vcr/retrieving/answers_returns_all_answered_survey_questions_for_a_question.yml
|
290
291
|
- spec/vcr/retrieving/answers_returns_answers.yml
|
291
292
|
- spec/vcr/retrieving/responses_returns_responses.yml
|
292
293
|
- spec/vcr/user/management_creates_a_user.yml
|
data/spec/requests/root_spec.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Poptart::Root do
|
4
|
-
it "builds urls", :vcr do
|
5
|
-
root = Poptart::Root.root
|
6
|
-
root.build_url('api/questions').should == 'http://localhost:3000/api/questions/'
|
7
|
-
root.build_url('api/questions', id: 1).should == 'http://localhost:3000/api/questions/1'
|
8
|
-
root.build_url('api/questions', id: 1, nested_resource: 'poptarts').should == 'http://localhost:3000/api/questions/1/poptarts'
|
9
|
-
root.build_url('api/questions', query: {space: 'cat'}).should == 'http://localhost:3000/api/questions/?space=cat'
|
10
|
-
end
|
11
|
-
end
|