poptart 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/poptart.rb +1 -4
- data/lib/poptart/link.rb +9 -0
- data/lib/poptart/model.rb +13 -29
- data/lib/poptart/question.rb +21 -17
- data/lib/poptart/root.rb +10 -1
- data/lib/poptart/survey.rb +34 -7
- data/lib/poptart/survey_question.rb +32 -12
- data/lib/poptart/user.rb +4 -21
- data/lib/version.rb +1 -1
- data/poptart.gemspec +0 -4
- data/spec/lib/poptart/model_spec.rb +95 -0
- data/spec/lib/poptart/question_spec.rb +47 -0
- data/spec/lib/poptart/root_spec.rb +50 -0
- data/spec/lib/poptart/survey_question_spec.rb +166 -0
- data/spec/lib/poptart/survey_spec.rb +105 -0
- data/spec/lib/poptart/user_spec.rb +45 -0
- data/spec/requests/questions_spec.rb +31 -0
- data/spec/requests/survey_questions_spec.rb +150 -0
- data/spec/requests/surveys_spec.rb +34 -5
- data/spec/requests/{user_management_spec.rb → users_spec.rb} +5 -5
- data/spec/spec_helper.rb +1 -4
- data/spec/vcr/answering/survey_questions_answers_a_multiple_choice_question.yml +1527 -1596
- data/spec/vcr/answering/survey_questions_answers_a_survey_question.yml +2942 -2035
- data/spec/vcr/answering/survey_questions_creates_and_returns_a_random_question_survey.yml +254 -70
- data/spec/vcr/answering/survey_questions_creates_and_returns_an_empty_survey.yml +110 -48
- data/spec/vcr/answering/survey_questions_finds_survey_question_for_id.yml +1618 -286
- data/spec/vcr/poptart/survey/adds_a_question_to_a_survey.yml +1939 -0
- data/spec/vcr/poptart/survey/creates_a_random_survey.yml +318 -0
- data/spec/vcr/poptart/survey/creates_an_empty_survey.yml +702 -0
- data/spec/vcr/poptart/survey/returns_a_survey_by_id.yml +618 -0
- data/spec/vcr/poptart/user/creates_a_user.yml +179 -0
- data/spec/vcr/{user/management_creates_a_user.yml → poptart/user/returns_a_user.yml} +72 -69
- data/spec/vcr/questions/creates_a_question.yml +186 -0
- data/spec/vcr/questions/finds_a_question_by_id.yml +326 -0
- data/spec/vcr/questions/finds_a_question_by_key.yml +144 -0
- data/spec/vcr/questions/returns_all_answered_survey_questions_for_a_question.yml +1021 -0
- data/spec/vcr/retrieving/answers_returns_all_answered_survey_questions_for_a_question.yml +533 -479
- data/spec/vcr/survey/questions_answers_a_multiple_choice_question.yml +1454 -0
- data/spec/vcr/survey/questions_answers_a_survey_question.yml +1772 -0
- data/spec/vcr/survey/questions_creates_and_returns_an_empty_survey.yml +372 -0
- data/spec/vcr/survey/questions_finds_survey_question_for_id.yml +3083 -0
- data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question.yml +5756 -0
- data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_question_by_key.yml +973 -0
- data/spec/vcr/survey/questions_returns_all_answered_survey_questions_for_a_survey.yml +620 -0
- metadata +55 -72
- data/lib/poptart/boolean_question.rb +0 -14
- data/lib/poptart/multiple_response_question.rb +0 -9
- data/lib/poptart/range_question.rb +0 -9
- data/lib/poptart/time_question.rb +0 -9
- data/spec/requests/answering_survey_questions_spec.rb +0 -79
- data/spec/requests/answers_spec.rb +0 -45
- data/spec/requests/creating_questions_spec.rb +0 -30
@@ -0,0 +1,179 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Api-Token:
|
15
|
+
- testing
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: 'OK '
|
24
|
+
headers:
|
25
|
+
X-Frame-Options:
|
26
|
+
- SAMEORIGIN
|
27
|
+
X-Xss-Protection:
|
28
|
+
- 1; mode=block
|
29
|
+
X-Content-Type-Options:
|
30
|
+
- nosniff
|
31
|
+
X-Ua-Compatible:
|
32
|
+
- chrome=1
|
33
|
+
Content-Type:
|
34
|
+
- application/json; charset=utf-8
|
35
|
+
Etag:
|
36
|
+
- '"3a543c1faf13608a2dcffc78fccf95fd"'
|
37
|
+
Cache-Control:
|
38
|
+
- max-age=0, private, must-revalidate
|
39
|
+
X-Request-Id:
|
40
|
+
- 224142bb-7247-4576-8e38-373a6491db44
|
41
|
+
X-Runtime:
|
42
|
+
- '0.006127'
|
43
|
+
Server:
|
44
|
+
- WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
|
45
|
+
Date:
|
46
|
+
- Sun, 25 Jan 2015 13:37:39 GMT
|
47
|
+
Content-Length:
|
48
|
+
- '1469'
|
49
|
+
Connection:
|
50
|
+
- Keep-Alive
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: |-
|
54
|
+
{
|
55
|
+
"_links": [
|
56
|
+
{
|
57
|
+
"href": "http://localhost:3000/",
|
58
|
+
"rel": "self",
|
59
|
+
"method": "GET"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"href": "http://localhost:3000/api/surveys{/id}{?query*}",
|
63
|
+
"rel": "surveys",
|
64
|
+
"method": "GET"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"href": "http://localhost:3000/api/surveys",
|
68
|
+
"rel": "surveys",
|
69
|
+
"method": "POST"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"href": "http://localhost:3000/api/user{/id}{?query*}",
|
73
|
+
"rel": "users",
|
74
|
+
"method": "GET"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"href": "http://localhost:3000/api/user",
|
78
|
+
"rel": "users",
|
79
|
+
"method": "POST"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"href": "http://localhost:3000/api/questions{/id}{?query*}",
|
83
|
+
"rel": "questions",
|
84
|
+
"method": "GET"
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"href": "http://localhost:3000/api/questions",
|
88
|
+
"rel": "questions",
|
89
|
+
"method": "POST"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}",
|
93
|
+
"rel": "survey-questions",
|
94
|
+
"method": "GET"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions",
|
98
|
+
"rel": "survey-questions",
|
99
|
+
"method": "POST"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}",
|
103
|
+
"rel": "survey-questions",
|
104
|
+
"method": "PUT"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"href": "http://localhost:3000/api/questions/survey_questions{?query*}",
|
108
|
+
"rel": "survey-questions-by-query",
|
109
|
+
"method": "GET"
|
110
|
+
}
|
111
|
+
]
|
112
|
+
}
|
113
|
+
http_version:
|
114
|
+
recorded_at: Sun, 25 Jan 2015 13:37:39 GMT
|
115
|
+
- request:
|
116
|
+
method: post
|
117
|
+
uri: http://localhost:3000/api/user
|
118
|
+
body:
|
119
|
+
encoding: UTF-8
|
120
|
+
string: "{}"
|
121
|
+
headers:
|
122
|
+
User-Agent:
|
123
|
+
- Faraday v0.9.0
|
124
|
+
Content-Type:
|
125
|
+
- application/json
|
126
|
+
Api-Token:
|
127
|
+
- testing
|
128
|
+
Accept-Encoding:
|
129
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
130
|
+
Accept:
|
131
|
+
- "*/*"
|
132
|
+
response:
|
133
|
+
status:
|
134
|
+
code: 201
|
135
|
+
message: 'Created '
|
136
|
+
headers:
|
137
|
+
X-Frame-Options:
|
138
|
+
- SAMEORIGIN
|
139
|
+
X-Xss-Protection:
|
140
|
+
- 1; mode=block
|
141
|
+
X-Content-Type-Options:
|
142
|
+
- nosniff
|
143
|
+
X-Ua-Compatible:
|
144
|
+
- chrome=1
|
145
|
+
Content-Type:
|
146
|
+
- application/json; charset=utf-8
|
147
|
+
Etag:
|
148
|
+
- '"8b035d9deedc38add24b298417e4ada0"'
|
149
|
+
Cache-Control:
|
150
|
+
- max-age=0, private, must-revalidate
|
151
|
+
X-Request-Id:
|
152
|
+
- 2e3699b7-1cac-4023-a01c-f7a483bf0600
|
153
|
+
X-Runtime:
|
154
|
+
- '0.008520'
|
155
|
+
Server:
|
156
|
+
- WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
|
157
|
+
Date:
|
158
|
+
- Sun, 25 Jan 2015 13:37:39 GMT
|
159
|
+
Content-Length:
|
160
|
+
- '292'
|
161
|
+
Connection:
|
162
|
+
- Keep-Alive
|
163
|
+
body:
|
164
|
+
encoding: UTF-8
|
165
|
+
string: |-
|
166
|
+
{
|
167
|
+
"service_user_id": "c20ea857f90b281eb1b19c6ec9d0012bd4bed705f9b16711d9ed5bd0d3cd52b5",
|
168
|
+
"_links": [
|
169
|
+
{
|
170
|
+
"href": "http://localhost:3000/api/user",
|
171
|
+
"rel": "self",
|
172
|
+
"method": "GET"
|
173
|
+
}
|
174
|
+
],
|
175
|
+
"token": "31c9f428651e64eb0c6bb7524fc7a7cfa3a0e8d8cdc4c0f6cb8b796c469adf75"
|
176
|
+
}
|
177
|
+
http_version:
|
178
|
+
recorded_at: Sun, 25 Jan 2015 13:37:39 GMT
|
179
|
+
recorded_with: VCR 2.9.3
|
@@ -1,11 +1,11 @@
|
|
1
1
|
---
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
|
-
method:
|
5
|
-
uri: http://localhost:3000/
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/
|
6
6
|
body:
|
7
|
-
encoding:
|
8
|
-
string:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
11
|
- Faraday v0.9.0
|
@@ -19,8 +19,8 @@ http_interactions:
|
|
19
19
|
- "*/*"
|
20
20
|
response:
|
21
21
|
status:
|
22
|
-
code:
|
23
|
-
message: '
|
22
|
+
code: 200
|
23
|
+
message: 'OK '
|
24
24
|
headers:
|
25
25
|
X-Frame-Options:
|
26
26
|
- SAMEORIGIN
|
@@ -33,42 +33,51 @@ http_interactions:
|
|
33
33
|
Content-Type:
|
34
34
|
- application/json; charset=utf-8
|
35
35
|
Etag:
|
36
|
-
- '"
|
36
|
+
- '"cd727c0ba392005a102fbf8dc32be000"'
|
37
37
|
Cache-Control:
|
38
38
|
- max-age=0, private, must-revalidate
|
39
39
|
X-Request-Id:
|
40
|
-
-
|
40
|
+
- 12010c2d-c474-45d0-975e-ca27601110fc
|
41
41
|
X-Runtime:
|
42
|
-
- '0.
|
42
|
+
- '0.008912'
|
43
43
|
Server:
|
44
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
44
|
+
- WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
|
45
45
|
Date:
|
46
|
-
- Sat,
|
46
|
+
- Sat, 03 Jan 2015 19:10:40 GMT
|
47
47
|
Content-Length:
|
48
|
-
- '
|
48
|
+
- '479'
|
49
49
|
Connection:
|
50
50
|
- Keep-Alive
|
51
51
|
body:
|
52
52
|
encoding: UTF-8
|
53
53
|
string: |-
|
54
54
|
{
|
55
|
-
"id": 13,
|
56
|
-
"service_user_id": "3aa49be2db36a85fe4c6b19e6345c8379836716ee035c972e748c7c71195864c",
|
57
55
|
"_links": {
|
58
56
|
"self": {
|
59
|
-
"href": "http://localhost:3000/
|
57
|
+
"href": "http://localhost:3000/"
|
58
|
+
},
|
59
|
+
"surveys": {
|
60
|
+
"href": "http://localhost:3000/api/surveys{/id}{?query*}"
|
61
|
+
},
|
62
|
+
"users": {
|
63
|
+
"href": "http://localhost:3000/api/user{/id}{?query*}"
|
64
|
+
},
|
65
|
+
"questions": {
|
66
|
+
"href": "http://localhost:3000/api/questions{/id}{?query*}"
|
67
|
+
},
|
68
|
+
"survey_questions": {
|
69
|
+
"href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}"
|
60
70
|
}
|
61
|
-
}
|
62
|
-
"token": "2965f424f516ad23160aecf4bb6c9131c31439a129a976981237b1b0fbd8754b"
|
71
|
+
}
|
63
72
|
}
|
64
73
|
http_version:
|
65
|
-
recorded_at: Sat,
|
74
|
+
recorded_at: Sat, 03 Jan 2015 19:10:40 GMT
|
66
75
|
- request:
|
67
|
-
method:
|
68
|
-
uri: http://localhost:3000/
|
76
|
+
method: post
|
77
|
+
uri: http://localhost:3000/api/user
|
69
78
|
body:
|
70
|
-
encoding:
|
71
|
-
string:
|
79
|
+
encoding: UTF-8
|
80
|
+
string: "{}"
|
72
81
|
headers:
|
73
82
|
User-Agent:
|
74
83
|
- Faraday v0.9.0
|
@@ -82,8 +91,8 @@ http_interactions:
|
|
82
91
|
- "*/*"
|
83
92
|
response:
|
84
93
|
status:
|
85
|
-
code:
|
86
|
-
message: '
|
94
|
+
code: 201
|
95
|
+
message: 'Created '
|
87
96
|
headers:
|
88
97
|
X-Frame-Options:
|
89
98
|
- SAMEORIGIN
|
@@ -96,51 +105,43 @@ http_interactions:
|
|
96
105
|
Content-Type:
|
97
106
|
- application/json; charset=utf-8
|
98
107
|
Etag:
|
99
|
-
- '"
|
108
|
+
- '"8b035d9deedc38add24b298417e4ada0"'
|
100
109
|
Cache-Control:
|
101
110
|
- max-age=0, private, must-revalidate
|
102
111
|
X-Request-Id:
|
103
|
-
-
|
112
|
+
- 264336a8-ef07-494f-a895-8410730faa84
|
104
113
|
X-Runtime:
|
105
|
-
- '0.
|
114
|
+
- '0.006582'
|
106
115
|
Server:
|
107
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
116
|
+
- WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
|
108
117
|
Date:
|
109
|
-
-
|
118
|
+
- Sun, 25 Jan 2015 13:37:39 GMT
|
110
119
|
Content-Length:
|
111
|
-
- '
|
120
|
+
- '292'
|
112
121
|
Connection:
|
113
122
|
- Keep-Alive
|
114
123
|
body:
|
115
124
|
encoding: UTF-8
|
116
125
|
string: |-
|
117
126
|
{
|
118
|
-
"
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
"
|
124
|
-
},
|
125
|
-
"users": {
|
126
|
-
"href": "http://localhost:3000/api/users{/id}{?query*}"
|
127
|
-
},
|
128
|
-
"questions": {
|
129
|
-
"href": "http://localhost:3000/api/questions{/id}{?query*}"
|
130
|
-
},
|
131
|
-
"survey_questions": {
|
132
|
-
"href": "http://localhost:3000/api/questions{/question_id}/survey_questions{?query*}"
|
127
|
+
"service_user_id": "c20ea857f90b281eb1b19c6ec9d0012bd4bed705f9b16711d9ed5bd0d3cd52b5",
|
128
|
+
"_links": [
|
129
|
+
{
|
130
|
+
"href": "http://localhost:3000/api/user",
|
131
|
+
"rel": "self",
|
132
|
+
"method": "GET"
|
133
133
|
}
|
134
|
-
|
134
|
+
],
|
135
|
+
"token": "31c9f428651e64eb0c6bb7524fc7a7cfa3a0e8d8cdc4c0f6cb8b796c469adf75"
|
135
136
|
}
|
136
137
|
http_version:
|
137
|
-
recorded_at:
|
138
|
+
recorded_at: Sun, 25 Jan 2015 13:37:39 GMT
|
138
139
|
- request:
|
139
|
-
method:
|
140
|
-
uri: http://localhost:3000/api/
|
140
|
+
method: get
|
141
|
+
uri: http://localhost:3000/api/user
|
141
142
|
body:
|
142
|
-
encoding:
|
143
|
-
string:
|
143
|
+
encoding: US-ASCII
|
144
|
+
string: ''
|
144
145
|
headers:
|
145
146
|
User-Agent:
|
146
147
|
- Faraday v0.9.0
|
@@ -149,17 +150,17 @@ http_interactions:
|
|
149
150
|
Api-Token:
|
150
151
|
- testing
|
151
152
|
User-Token:
|
152
|
-
-
|
153
|
+
- 31c9f428651e64eb0c6bb7524fc7a7cfa3a0e8d8cdc4c0f6cb8b796c469adf75
|
153
154
|
Service-User-Id:
|
154
|
-
-
|
155
|
+
- c20ea857f90b281eb1b19c6ec9d0012bd4bed705f9b16711d9ed5bd0d3cd52b5
|
155
156
|
Accept-Encoding:
|
156
157
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
157
158
|
Accept:
|
158
159
|
- "*/*"
|
159
160
|
response:
|
160
161
|
status:
|
161
|
-
code:
|
162
|
-
message: '
|
162
|
+
code: 200
|
163
|
+
message: 'OK '
|
163
164
|
headers:
|
164
165
|
X-Frame-Options:
|
165
166
|
- SAMEORIGIN
|
@@ -172,33 +173,35 @@ http_interactions:
|
|
172
173
|
Content-Type:
|
173
174
|
- application/json; charset=utf-8
|
174
175
|
Etag:
|
175
|
-
- '"
|
176
|
+
- '"8b035d9deedc38add24b298417e4ada0"'
|
176
177
|
Cache-Control:
|
177
178
|
- max-age=0, private, must-revalidate
|
178
179
|
X-Request-Id:
|
179
|
-
-
|
180
|
+
- 7c4ade70-1f4e-468c-9690-1426a6dd9efb
|
180
181
|
X-Runtime:
|
181
|
-
- '0.
|
182
|
+
- '0.007437'
|
182
183
|
Server:
|
183
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
184
|
+
- WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
|
184
185
|
Date:
|
185
|
-
-
|
186
|
+
- Sun, 25 Jan 2015 13:37:39 GMT
|
186
187
|
Content-Length:
|
187
|
-
- '
|
188
|
+
- '292'
|
188
189
|
Connection:
|
189
190
|
- Keep-Alive
|
190
191
|
body:
|
191
192
|
encoding: UTF-8
|
192
193
|
string: |-
|
193
194
|
{
|
194
|
-
"service_user_id": "
|
195
|
-
"_links":
|
196
|
-
|
197
|
-
"href": "http://localhost:3000/api/
|
195
|
+
"service_user_id": "c20ea857f90b281eb1b19c6ec9d0012bd4bed705f9b16711d9ed5bd0d3cd52b5",
|
196
|
+
"_links": [
|
197
|
+
{
|
198
|
+
"href": "http://localhost:3000/api/user",
|
199
|
+
"rel": "self",
|
200
|
+
"method": "GET"
|
198
201
|
}
|
199
|
-
|
200
|
-
"token": "
|
202
|
+
],
|
203
|
+
"token": "31c9f428651e64eb0c6bb7524fc7a7cfa3a0e8d8cdc4c0f6cb8b796c469adf75"
|
201
204
|
}
|
202
205
|
http_version:
|
203
|
-
recorded_at:
|
204
|
-
recorded_with: VCR 2.
|
206
|
+
recorded_at: Sun, 25 Jan 2015 13:37:39 GMT
|
207
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,186 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:3000/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
Api-Token:
|
15
|
+
- testing
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: 'OK '
|
24
|
+
headers:
|
25
|
+
X-Frame-Options:
|
26
|
+
- SAMEORIGIN
|
27
|
+
X-Xss-Protection:
|
28
|
+
- 1; mode=block
|
29
|
+
X-Content-Type-Options:
|
30
|
+
- nosniff
|
31
|
+
X-Ua-Compatible:
|
32
|
+
- chrome=1
|
33
|
+
Content-Type:
|
34
|
+
- application/json; charset=utf-8
|
35
|
+
Etag:
|
36
|
+
- '"3a543c1faf13608a2dcffc78fccf95fd"'
|
37
|
+
Cache-Control:
|
38
|
+
- max-age=0, private, must-revalidate
|
39
|
+
X-Request-Id:
|
40
|
+
- c6203d4d-c29b-47f4-ad8c-a1e27cee085b
|
41
|
+
X-Runtime:
|
42
|
+
- '0.068678'
|
43
|
+
Server:
|
44
|
+
- WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
|
45
|
+
Date:
|
46
|
+
- Sun, 25 Jan 2015 13:35:18 GMT
|
47
|
+
Content-Length:
|
48
|
+
- '1469'
|
49
|
+
Connection:
|
50
|
+
- Keep-Alive
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: |-
|
54
|
+
{
|
55
|
+
"_links": [
|
56
|
+
{
|
57
|
+
"href": "http://localhost:3000/",
|
58
|
+
"rel": "self",
|
59
|
+
"method": "GET"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"href": "http://localhost:3000/api/surveys{/id}{?query*}",
|
63
|
+
"rel": "surveys",
|
64
|
+
"method": "GET"
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"href": "http://localhost:3000/api/surveys",
|
68
|
+
"rel": "surveys",
|
69
|
+
"method": "POST"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"href": "http://localhost:3000/api/user{/id}{?query*}",
|
73
|
+
"rel": "users",
|
74
|
+
"method": "GET"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"href": "http://localhost:3000/api/user",
|
78
|
+
"rel": "users",
|
79
|
+
"method": "POST"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"href": "http://localhost:3000/api/questions{/id}{?query*}",
|
83
|
+
"rel": "questions",
|
84
|
+
"method": "GET"
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"href": "http://localhost:3000/api/questions",
|
88
|
+
"rel": "questions",
|
89
|
+
"method": "POST"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}{?query*}",
|
93
|
+
"rel": "survey-questions",
|
94
|
+
"method": "GET"
|
95
|
+
},
|
96
|
+
{
|
97
|
+
"href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions",
|
98
|
+
"rel": "survey-questions",
|
99
|
+
"method": "POST"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"href": "http://localhost:3000/api/questions/surveys/{survey_id}/survey_questions{/id}",
|
103
|
+
"rel": "survey-questions",
|
104
|
+
"method": "PUT"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"href": "http://localhost:3000/api/questions/survey_questions{?query*}",
|
108
|
+
"rel": "survey-questions-by-query",
|
109
|
+
"method": "GET"
|
110
|
+
}
|
111
|
+
]
|
112
|
+
}
|
113
|
+
http_version:
|
114
|
+
recorded_at: Sun, 25 Jan 2015 13:35:18 GMT
|
115
|
+
- request:
|
116
|
+
method: post
|
117
|
+
uri: http://localhost:3000/api/questions
|
118
|
+
body:
|
119
|
+
encoding: UTF-8
|
120
|
+
string: '{"question":{"question_type":"boolean","responses":[true,false],"text":"Do
|
121
|
+
you like poptarts?","key":"poptarts"}}'
|
122
|
+
headers:
|
123
|
+
User-Agent:
|
124
|
+
- Faraday v0.9.0
|
125
|
+
Content-Type:
|
126
|
+
- application/json
|
127
|
+
Api-Token:
|
128
|
+
- testing
|
129
|
+
Accept-Encoding:
|
130
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
131
|
+
Accept:
|
132
|
+
- "*/*"
|
133
|
+
response:
|
134
|
+
status:
|
135
|
+
code: 201
|
136
|
+
message: 'Created '
|
137
|
+
headers:
|
138
|
+
X-Frame-Options:
|
139
|
+
- SAMEORIGIN
|
140
|
+
X-Xss-Protection:
|
141
|
+
- 1; mode=block
|
142
|
+
X-Content-Type-Options:
|
143
|
+
- nosniff
|
144
|
+
X-Ua-Compatible:
|
145
|
+
- chrome=1
|
146
|
+
Content-Type:
|
147
|
+
- application/json; charset=utf-8
|
148
|
+
Etag:
|
149
|
+
- '"49c89253cd49f6f1a2afca94fa524df9"'
|
150
|
+
Cache-Control:
|
151
|
+
- max-age=0, private, must-revalidate
|
152
|
+
X-Request-Id:
|
153
|
+
- a8b92fa6-055e-45c3-8689-5ba6dc70b808
|
154
|
+
X-Runtime:
|
155
|
+
- '0.023817'
|
156
|
+
Server:
|
157
|
+
- WEBrick/1.3.1 (Ruby/2.1.3/2014-09-19)
|
158
|
+
Date:
|
159
|
+
- Sun, 25 Jan 2015 13:35:18 GMT
|
160
|
+
Content-Length:
|
161
|
+
- '272'
|
162
|
+
Connection:
|
163
|
+
- Keep-Alive
|
164
|
+
body:
|
165
|
+
encoding: UTF-8
|
166
|
+
string: |-
|
167
|
+
{
|
168
|
+
"id": 79,
|
169
|
+
"question_type": "boolean",
|
170
|
+
"text": "Do you like poptarts?",
|
171
|
+
"responses": [
|
172
|
+
true,
|
173
|
+
false
|
174
|
+
],
|
175
|
+
"key": "poptarts",
|
176
|
+
"_links": [
|
177
|
+
{
|
178
|
+
"rel": "self",
|
179
|
+
"href": "http://localhost:3000/api/questions/79",
|
180
|
+
"method": "GET"
|
181
|
+
}
|
182
|
+
]
|
183
|
+
}
|
184
|
+
http_version:
|
185
|
+
recorded_at: Sun, 25 Jan 2015 13:35:18 GMT
|
186
|
+
recorded_with: VCR 2.9.3
|