poptart 0.0.6 → 0.0.7
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/README.md +35 -0
- data/lib/poptart/survey.rb +2 -2
- data/lib/poptart/user.rb +2 -2
- data/lib/version.rb +1 -1
- data/spec/requests/answering_survey_questions_spec.rb +2 -2
- data/spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml +1003 -77
- data/spec/vcr/answering/survey_questions_answers_a_survey_question.yml +1585 -346
- data/spec/vcr/answering/survey_questions_creates_and_returns_a_random_question_survey.yml +63 -74
- data/spec/vcr/answering/survey_questions_creates_and_returns_an_empty_survey.yml +29 -30
- data/spec/vcr/answering/survey_questions_finds_survey_question_for_id.yml +65 -110
- metadata +2 -2
@@ -796,13 +796,13 @@ http_interactions:
|
|
796
796
|
Cache-Control:
|
797
797
|
- max-age=0, private, must-revalidate
|
798
798
|
X-Request-Id:
|
799
|
-
-
|
799
|
+
- 7a8448a3-8776-45c6-9da4-26503f624c35
|
800
800
|
X-Runtime:
|
801
|
-
- '0.
|
801
|
+
- '0.004675'
|
802
802
|
Server:
|
803
803
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
804
804
|
Date:
|
805
|
-
- Sun,
|
805
|
+
- Sun, 21 Sep 2014 20:27:58 GMT
|
806
806
|
Content-Length:
|
807
807
|
- '236'
|
808
808
|
Connection:
|
@@ -827,7 +827,7 @@ http_interactions:
|
|
827
827
|
}
|
828
828
|
}
|
829
829
|
http_version:
|
830
|
-
recorded_at: Sun,
|
830
|
+
recorded_at: Sun, 21 Sep 2014 20:27:58 GMT
|
831
831
|
- request:
|
832
832
|
method: get
|
833
833
|
uri: http://localhost:3000/
|
@@ -865,13 +865,13 @@ http_interactions:
|
|
865
865
|
Cache-Control:
|
866
866
|
- max-age=0, private, must-revalidate
|
867
867
|
X-Request-Id:
|
868
|
-
-
|
868
|
+
- c0b488c3-fa05-4478-8007-0d99843d126b
|
869
869
|
X-Runtime:
|
870
|
-
- '0.
|
870
|
+
- '0.004353'
|
871
871
|
Server:
|
872
872
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
873
873
|
Date:
|
874
|
-
- Sun,
|
874
|
+
- Sun, 21 Sep 2014 20:27:58 GMT
|
875
875
|
Content-Length:
|
876
876
|
- '236'
|
877
877
|
Connection:
|
@@ -896,7 +896,7 @@ http_interactions:
|
|
896
896
|
}
|
897
897
|
}
|
898
898
|
http_version:
|
899
|
-
recorded_at: Sun,
|
899
|
+
recorded_at: Sun, 21 Sep 2014 20:27:58 GMT
|
900
900
|
- request:
|
901
901
|
method: post
|
902
902
|
uri: http://localhost:3000/api/users/
|
@@ -930,42 +930,41 @@ http_interactions:
|
|
930
930
|
Content-Type:
|
931
931
|
- application/json; charset=utf-8
|
932
932
|
Etag:
|
933
|
-
- '"
|
933
|
+
- '"5c7cd5eee925d606fbf02d5e2247fc21"'
|
934
934
|
Cache-Control:
|
935
935
|
- max-age=0, private, must-revalidate
|
936
936
|
X-Request-Id:
|
937
|
-
-
|
937
|
+
- 0d6b260c-9959-42e3-8f15-a0ac1fd7c376
|
938
938
|
X-Runtime:
|
939
|
-
- '0.
|
939
|
+
- '0.006931'
|
940
940
|
Server:
|
941
941
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
942
942
|
Date:
|
943
|
-
-
|
943
|
+
- Sun, 21 Sep 2014 20:28:01 GMT
|
944
944
|
Content-Length:
|
945
|
-
- '
|
945
|
+
- '260'
|
946
946
|
Connection:
|
947
947
|
- Keep-Alive
|
948
948
|
body:
|
949
949
|
encoding: UTF-8
|
950
950
|
string: |-
|
951
951
|
{
|
952
|
-
"
|
953
|
-
"service_user_id": "9d478ee79f431c1667f39d26c8069fa197a0d914f318764ffb4bab6b6c4f135f",
|
952
|
+
"service_user_id": "e81f9df2f19ac3d0e4634061bff685bbb732abb269049eafdd4fa9ae7c836c6b",
|
954
953
|
"_links": {
|
955
954
|
"self": {
|
956
|
-
"href": "http://localhost:3000/api/users/
|
955
|
+
"href": "http://localhost:3000/api/users/83"
|
957
956
|
}
|
958
957
|
},
|
959
|
-
"token": "
|
958
|
+
"token": "c2ffdad2f8fb5aa69b36f5ea0468938657cf4a56a20fd6fda99e9f279b8f8b89"
|
960
959
|
}
|
961
960
|
http_version:
|
962
|
-
recorded_at:
|
961
|
+
recorded_at: Sun, 21 Sep 2014 20:28:01 GMT
|
963
962
|
- request:
|
964
963
|
method: post
|
965
964
|
uri: http://localhost:3000/api/surveys/?random=true
|
966
965
|
body:
|
967
966
|
encoding: UTF-8
|
968
|
-
string: '{"survey":{"
|
967
|
+
string: '{"survey":{"service_user_id":"e81f9df2f19ac3d0e4634061bff685bbb732abb269049eafdd4fa9ae7c836c6b"}}'
|
969
968
|
headers:
|
970
969
|
User-Agent:
|
971
970
|
- Faraday v0.9.0
|
@@ -993,44 +992,44 @@ http_interactions:
|
|
993
992
|
Content-Type:
|
994
993
|
- application/json; charset=utf-8
|
995
994
|
Etag:
|
996
|
-
- '"
|
995
|
+
- '"5a752cce440e83f19c183e067f96cb30"'
|
997
996
|
Cache-Control:
|
998
997
|
- max-age=0, private, must-revalidate
|
999
998
|
X-Request-Id:
|
1000
|
-
-
|
999
|
+
- e52bfe39-dcf1-4b4b-aeb9-7a087ff3faaa
|
1001
1000
|
X-Runtime:
|
1002
|
-
- '0.
|
1001
|
+
- '0.047594'
|
1003
1002
|
Server:
|
1004
1003
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
1005
1004
|
Date:
|
1006
|
-
-
|
1005
|
+
- Sun, 21 Sep 2014 20:28:01 GMT
|
1007
1006
|
Content-Length:
|
1008
|
-
- '
|
1007
|
+
- '3393'
|
1009
1008
|
Connection:
|
1010
1009
|
- Keep-Alive
|
1011
1010
|
body:
|
1012
1011
|
encoding: UTF-8
|
1013
1012
|
string: |-
|
1014
1013
|
{
|
1015
|
-
"id":
|
1016
|
-
"
|
1014
|
+
"id": 83,
|
1015
|
+
"service_user_id": "e81f9df2f19ac3d0e4634061bff685bbb732abb269049eafdd4fa9ae7c836c6b",
|
1017
1016
|
"_links": {
|
1018
1017
|
"self": {
|
1019
|
-
"href": "http://localhost:3000/api/surveys/
|
1018
|
+
"href": "http://localhost:3000/api/surveys/83"
|
1020
1019
|
},
|
1021
1020
|
"survey_questions": {
|
1022
1021
|
"post": {
|
1023
|
-
"href": "/api/surveys/
|
1022
|
+
"href": "/api/surveys/83/survey_questions"
|
1024
1023
|
},
|
1025
1024
|
"put": {
|
1026
|
-
"href": "/api/surveys/
|
1025
|
+
"href": "/api/surveys/83/survey_questions"
|
1027
1026
|
}
|
1028
1027
|
}
|
1029
1028
|
},
|
1030
1029
|
"completed": false,
|
1031
1030
|
"survey_questions": [
|
1032
1031
|
{
|
1033
|
-
"id":
|
1032
|
+
"id": 262,
|
1034
1033
|
"text": "How do you feel right now?",
|
1035
1034
|
"type": "range",
|
1036
1035
|
"responses": [
|
@@ -1041,21 +1040,21 @@ http_interactions:
|
|
1041
1040
|
"freeform": false,
|
1042
1041
|
"_links": {
|
1043
1042
|
"self": {
|
1044
|
-
"href": "/api/surveys/
|
1043
|
+
"href": "/api/surveys/83/survey_questions/262"
|
1045
1044
|
},
|
1046
1045
|
"post": {
|
1047
|
-
"href": "http://localhost:3000/api/surveys/
|
1046
|
+
"href": "http://localhost:3000/api/surveys/83/survey_questions"
|
1048
1047
|
},
|
1049
1048
|
"put": {
|
1050
|
-
"href": "/api/surveys/
|
1049
|
+
"href": "/api/surveys/83/survey_questions/262"
|
1051
1050
|
},
|
1052
1051
|
"survey": {
|
1053
|
-
"href": "/api/surveys/
|
1052
|
+
"href": "/api/surveys/83"
|
1054
1053
|
}
|
1055
1054
|
}
|
1056
1055
|
},
|
1057
1056
|
{
|
1058
|
-
"id":
|
1057
|
+
"id": 263,
|
1059
1058
|
"text": "Where are you?",
|
1060
1059
|
"type": "multiple",
|
1061
1060
|
"responses": [
|
@@ -1068,54 +1067,47 @@ http_interactions:
|
|
1068
1067
|
"freeform": true,
|
1069
1068
|
"_links": {
|
1070
1069
|
"self": {
|
1071
|
-
"href": "/api/surveys/
|
1070
|
+
"href": "/api/surveys/83/survey_questions/263"
|
1072
1071
|
},
|
1073
1072
|
"post": {
|
1074
|
-
"href": "http://localhost:3000/api/surveys/
|
1073
|
+
"href": "http://localhost:3000/api/surveys/83/survey_questions"
|
1075
1074
|
},
|
1076
1075
|
"put": {
|
1077
|
-
"href": "/api/surveys/
|
1076
|
+
"href": "/api/surveys/83/survey_questions/263"
|
1078
1077
|
},
|
1079
1078
|
"survey": {
|
1080
|
-
"href": "/api/surveys/
|
1079
|
+
"href": "/api/surveys/83"
|
1081
1080
|
}
|
1082
1081
|
}
|
1083
1082
|
},
|
1084
1083
|
{
|
1085
|
-
"id":
|
1086
|
-
"text": "
|
1087
|
-
"type": "
|
1084
|
+
"id": 264,
|
1085
|
+
"text": "Have you surprised someone with a gift (including small gifts) in the last week?",
|
1086
|
+
"type": "boolean",
|
1088
1087
|
"responses": [
|
1089
|
-
"
|
1090
|
-
"
|
1091
|
-
"10-20",
|
1092
|
-
"20-30",
|
1093
|
-
"30-40",
|
1094
|
-
"40-50",
|
1095
|
-
"50-60",
|
1096
|
-
"60-70",
|
1097
|
-
"More than 70"
|
1088
|
+
"t",
|
1089
|
+
"f"
|
1098
1090
|
],
|
1099
1091
|
"answer": null,
|
1100
1092
|
"freeform": false,
|
1101
1093
|
"_links": {
|
1102
1094
|
"self": {
|
1103
|
-
"href": "/api/surveys/
|
1095
|
+
"href": "/api/surveys/83/survey_questions/264"
|
1104
1096
|
},
|
1105
1097
|
"post": {
|
1106
|
-
"href": "http://localhost:3000/api/surveys/
|
1098
|
+
"href": "http://localhost:3000/api/surveys/83/survey_questions"
|
1107
1099
|
},
|
1108
1100
|
"put": {
|
1109
|
-
"href": "/api/surveys/
|
1101
|
+
"href": "/api/surveys/83/survey_questions/264"
|
1110
1102
|
},
|
1111
1103
|
"survey": {
|
1112
|
-
"href": "/api/surveys/
|
1104
|
+
"href": "/api/surveys/83"
|
1113
1105
|
}
|
1114
1106
|
}
|
1115
1107
|
},
|
1116
1108
|
{
|
1117
|
-
"id":
|
1118
|
-
"text": "
|
1109
|
+
"id": 265,
|
1110
|
+
"text": "Are you alone?",
|
1119
1111
|
"type": "boolean",
|
1120
1112
|
"responses": [
|
1121
1113
|
"t",
|
@@ -1125,49 +1117,46 @@ http_interactions:
|
|
1125
1117
|
"freeform": false,
|
1126
1118
|
"_links": {
|
1127
1119
|
"self": {
|
1128
|
-
"href": "/api/surveys/
|
1120
|
+
"href": "/api/surveys/83/survey_questions/265"
|
1129
1121
|
},
|
1130
1122
|
"post": {
|
1131
|
-
"href": "http://localhost:3000/api/surveys/
|
1123
|
+
"href": "http://localhost:3000/api/surveys/83/survey_questions"
|
1132
1124
|
},
|
1133
1125
|
"put": {
|
1134
|
-
"href": "/api/surveys/
|
1126
|
+
"href": "/api/surveys/83/survey_questions/265"
|
1135
1127
|
},
|
1136
1128
|
"survey": {
|
1137
|
-
"href": "/api/surveys/
|
1129
|
+
"href": "/api/surveys/83"
|
1138
1130
|
}
|
1139
1131
|
}
|
1140
1132
|
},
|
1141
1133
|
{
|
1142
|
-
"id":
|
1143
|
-
"text": "In
|
1144
|
-
"type": "
|
1134
|
+
"id": 266,
|
1135
|
+
"text": "In the past 24 hours, have you engaged in sexual activity with another person?",
|
1136
|
+
"type": "boolean",
|
1145
1137
|
"responses": [
|
1146
|
-
"
|
1147
|
-
"
|
1148
|
-
"Good",
|
1149
|
-
"Fair",
|
1150
|
-
"Poor"
|
1138
|
+
"t",
|
1139
|
+
"f"
|
1151
1140
|
],
|
1152
1141
|
"answer": null,
|
1153
1142
|
"freeform": false,
|
1154
1143
|
"_links": {
|
1155
1144
|
"self": {
|
1156
|
-
"href": "/api/surveys/
|
1145
|
+
"href": "/api/surveys/83/survey_questions/266"
|
1157
1146
|
},
|
1158
1147
|
"post": {
|
1159
|
-
"href": "http://localhost:3000/api/surveys/
|
1148
|
+
"href": "http://localhost:3000/api/surveys/83/survey_questions"
|
1160
1149
|
},
|
1161
1150
|
"put": {
|
1162
|
-
"href": "/api/surveys/
|
1151
|
+
"href": "/api/surveys/83/survey_questions/266"
|
1163
1152
|
},
|
1164
1153
|
"survey": {
|
1165
|
-
"href": "/api/surveys/
|
1154
|
+
"href": "/api/surveys/83"
|
1166
1155
|
}
|
1167
1156
|
}
|
1168
1157
|
}
|
1169
1158
|
]
|
1170
1159
|
}
|
1171
1160
|
http_version:
|
1172
|
-
recorded_at:
|
1161
|
+
recorded_at: Sun, 21 Sep 2014 20:28:01 GMT
|
1173
1162
|
recorded_with: VCR 2.6.0
|
@@ -639,13 +639,13 @@ http_interactions:
|
|
639
639
|
Cache-Control:
|
640
640
|
- max-age=0, private, must-revalidate
|
641
641
|
X-Request-Id:
|
642
|
-
-
|
642
|
+
- f8360f86-4721-4525-9143-afcf8e409220
|
643
643
|
X-Runtime:
|
644
|
-
- '0.
|
644
|
+
- '0.005768'
|
645
645
|
Server:
|
646
646
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
647
647
|
Date:
|
648
|
-
-
|
648
|
+
- Sun, 21 Sep 2014 20:28:00 GMT
|
649
649
|
Content-Length:
|
650
650
|
- '236'
|
651
651
|
Connection:
|
@@ -670,7 +670,7 @@ http_interactions:
|
|
670
670
|
}
|
671
671
|
}
|
672
672
|
http_version:
|
673
|
-
recorded_at:
|
673
|
+
recorded_at: Sun, 21 Sep 2014 20:28:00 GMT
|
674
674
|
- request:
|
675
675
|
method: get
|
676
676
|
uri: http://localhost:3000/
|
@@ -708,13 +708,13 @@ http_interactions:
|
|
708
708
|
Cache-Control:
|
709
709
|
- max-age=0, private, must-revalidate
|
710
710
|
X-Request-Id:
|
711
|
-
-
|
711
|
+
- 79b06cac-71d9-4540-974a-f904f3a420af
|
712
712
|
X-Runtime:
|
713
|
-
- '0.
|
713
|
+
- '0.006611'
|
714
714
|
Server:
|
715
715
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
716
716
|
Date:
|
717
|
-
-
|
717
|
+
- Sun, 21 Sep 2014 20:28:00 GMT
|
718
718
|
Content-Length:
|
719
719
|
- '236'
|
720
720
|
Connection:
|
@@ -739,7 +739,7 @@ http_interactions:
|
|
739
739
|
}
|
740
740
|
}
|
741
741
|
http_version:
|
742
|
-
recorded_at:
|
742
|
+
recorded_at: Sun, 21 Sep 2014 20:28:00 GMT
|
743
743
|
- request:
|
744
744
|
method: post
|
745
745
|
uri: http://localhost:3000/api/users/
|
@@ -773,42 +773,41 @@ http_interactions:
|
|
773
773
|
Content-Type:
|
774
774
|
- application/json; charset=utf-8
|
775
775
|
Etag:
|
776
|
-
- '"
|
776
|
+
- '"624fa492a51bf95b510c63f10516c9e1"'
|
777
777
|
Cache-Control:
|
778
778
|
- max-age=0, private, must-revalidate
|
779
779
|
X-Request-Id:
|
780
|
-
-
|
780
|
+
- 554f38a5-83ea-4d2f-a5a5-b7d9f397ef38
|
781
781
|
X-Runtime:
|
782
|
-
- '0.
|
782
|
+
- '0.009139'
|
783
783
|
Server:
|
784
784
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
785
785
|
Date:
|
786
|
-
-
|
786
|
+
- Sun, 21 Sep 2014 20:28:01 GMT
|
787
787
|
Content-Length:
|
788
|
-
- '
|
788
|
+
- '260'
|
789
789
|
Connection:
|
790
790
|
- Keep-Alive
|
791
791
|
body:
|
792
792
|
encoding: UTF-8
|
793
793
|
string: |-
|
794
794
|
{
|
795
|
-
"
|
796
|
-
"service_user_id": "9d478ee79f431c1667f39d26c8069fa197a0d914f318764ffb4bab6b6c4f135f",
|
795
|
+
"service_user_id": "e81f9df2f19ac3d0e4634061bff685bbb732abb269049eafdd4fa9ae7c836c6b",
|
797
796
|
"_links": {
|
798
797
|
"self": {
|
799
|
-
"href": "http://localhost:3000/api/users/
|
798
|
+
"href": "http://localhost:3000/api/users/82"
|
800
799
|
}
|
801
800
|
},
|
802
|
-
"token": "
|
801
|
+
"token": "c2ffdad2f8fb5aa69b36f5ea0468938657cf4a56a20fd6fda99e9f279b8f8b89"
|
803
802
|
}
|
804
803
|
http_version:
|
805
|
-
recorded_at:
|
804
|
+
recorded_at: Sun, 21 Sep 2014 20:28:01 GMT
|
806
805
|
- request:
|
807
806
|
method: post
|
808
807
|
uri: http://localhost:3000/api/surveys/
|
809
808
|
body:
|
810
809
|
encoding: UTF-8
|
811
|
-
string: '{"survey":{"
|
810
|
+
string: '{"survey":{"service_user_id":"e81f9df2f19ac3d0e4634061bff685bbb732abb269049eafdd4fa9ae7c836c6b"}}'
|
812
811
|
headers:
|
813
812
|
User-Agent:
|
814
813
|
- Faraday v0.9.0
|
@@ -836,37 +835,37 @@ http_interactions:
|
|
836
835
|
Content-Type:
|
837
836
|
- application/json; charset=utf-8
|
838
837
|
Etag:
|
839
|
-
- '"
|
838
|
+
- '"5bbe949d28bdd6a9071aa4d4a516d95d"'
|
840
839
|
Cache-Control:
|
841
840
|
- max-age=0, private, must-revalidate
|
842
841
|
X-Request-Id:
|
843
|
-
-
|
842
|
+
- 4cc973a4-748a-4f02-897e-4fbf9b010136
|
844
843
|
X-Runtime:
|
845
|
-
- '0.
|
844
|
+
- '0.011637'
|
846
845
|
Server:
|
847
846
|
- WEBrick/1.3.1 (Ruby/2.1.2/2014-05-08)
|
848
847
|
Date:
|
849
|
-
-
|
848
|
+
- Sun, 21 Sep 2014 20:28:01 GMT
|
850
849
|
Content-Length:
|
851
|
-
- '
|
850
|
+
- '430'
|
852
851
|
Connection:
|
853
852
|
- Keep-Alive
|
854
853
|
body:
|
855
854
|
encoding: UTF-8
|
856
855
|
string: |-
|
857
856
|
{
|
858
|
-
"id":
|
859
|
-
"
|
857
|
+
"id": 82,
|
858
|
+
"service_user_id": "e81f9df2f19ac3d0e4634061bff685bbb732abb269049eafdd4fa9ae7c836c6b",
|
860
859
|
"_links": {
|
861
860
|
"self": {
|
862
|
-
"href": "http://localhost:3000/api/surveys/
|
861
|
+
"href": "http://localhost:3000/api/surveys/82"
|
863
862
|
},
|
864
863
|
"survey_questions": {
|
865
864
|
"post": {
|
866
|
-
"href": "/api/surveys/
|
865
|
+
"href": "/api/surveys/82/survey_questions"
|
867
866
|
},
|
868
867
|
"put": {
|
869
|
-
"href": "/api/surveys/
|
868
|
+
"href": "/api/surveys/82/survey_questions"
|
870
869
|
}
|
871
870
|
}
|
872
871
|
},
|
@@ -876,5 +875,5 @@ http_interactions:
|
|
876
875
|
]
|
877
876
|
}
|
878
877
|
http_version:
|
879
|
-
recorded_at:
|
878
|
+
recorded_at: Sun, 21 Sep 2014 20:28:01 GMT
|
880
879
|
recorded_with: VCR 2.6.0
|