reviewed 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.gitignore +18 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +4 -0
  4. data/Guardfile +8 -0
  5. data/LICENSE +22 -0
  6. data/README.md +36 -0
  7. data/Rakefile +9 -0
  8. data/lib/reviewed/article.rb +18 -0
  9. data/lib/reviewed/author.rb +4 -0
  10. data/lib/reviewed/base.rb +56 -0
  11. data/lib/reviewed/brand.rb +4 -0
  12. data/lib/reviewed/collection.rb +66 -0
  13. data/lib/reviewed/product.rb +14 -0
  14. data/lib/reviewed/request.rb +23 -0
  15. data/lib/reviewed/response.rb +12 -0
  16. data/lib/reviewed/util.rb +16 -0
  17. data/lib/reviewed/version.rb +4 -0
  18. data/lib/reviewed/website.rb +4 -0
  19. data/lib/reviewed.rb +52 -0
  20. data/reviewed.gemspec +26 -0
  21. data/spec/article_spec.rb +33 -0
  22. data/spec/author_spec.rb +4 -0
  23. data/spec/base_spec.rb +127 -0
  24. data/spec/brand_spec.rb +4 -0
  25. data/spec/collection_spec.rb +83 -0
  26. data/spec/fixtures/vcr/article/attachments.yml +281 -0
  27. data/spec/fixtures/vcr/article/find_page.yml +189 -0
  28. data/spec/fixtures/vcr/base/find_error_key.yml +239 -0
  29. data/spec/fixtures/vcr/base/find_ok.yml +310 -0
  30. data/spec/fixtures/vcr/base/where_collection.yml +1958 -0
  31. data/spec/fixtures/vcr/collection/products.yml +1416 -0
  32. data/spec/fixtures/vcr/product/attachments.yml +84 -0
  33. data/spec/fixtures/vcr/request/authors.yml +144 -0
  34. data/spec/fixtures/vcr/response/authors.yml +144 -0
  35. data/spec/product_spec.rb +23 -0
  36. data/spec/request_spec.rb +15 -0
  37. data/spec/response_spec.rb +26 -0
  38. data/spec/spec_helper.rb +25 -0
  39. data/spec/support/.gitkeep +0 -0
  40. data/spec/util_spec.rb +33 -0
  41. data/spec/website_spec.rb +4 -0
  42. metadata +221 -0
@@ -0,0 +1,239 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://the-guide-staging.herokuapp.com/api/v1/websites/50241b9c5da4ac8d38000001
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ X-Reviewed-Authorization:
15
+ - xxxxxxxxxxxxxxxx
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 401
21
+ message: Unauthorized
22
+ headers:
23
+ Access-Control-Allow-Credentials:
24
+ - 'true'
25
+ Access-Control-Allow-Headers:
26
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
27
+ Content-Type
28
+ Access-Control-Allow-Methods:
29
+ - OPTIONS, GET, POST, PUT, DELETE
30
+ Access-Control-Allow-Origin:
31
+ - ! '*'
32
+ Access-Control-Max-Age:
33
+ - '1000'
34
+ Cache-Control:
35
+ - no-cache, no-store
36
+ Content-Type:
37
+ - application/json; charset=utf-8
38
+ Date:
39
+ - Wed, 29 Aug 2012 03:23:03 GMT
40
+ Server:
41
+ - thin 1.4.1 codename Chromeo
42
+ Strict-Transport-Security:
43
+ - max-age=31536000
44
+ X-Rack-Cache:
45
+ - miss
46
+ X-Request-Id:
47
+ - c0a80c5c187bf43077d7996fb4a46540
48
+ X-Runtime:
49
+ - '0.012044'
50
+ X-Ua-Compatible:
51
+ - IE=Edge,chrome=1
52
+ Transfer-Encoding:
53
+ - chunked
54
+ Connection:
55
+ - keep-alive
56
+ body:
57
+ encoding: US-ASCII
58
+ string: ! '{"message":"Api Key not found"}'
59
+ http_version:
60
+ recorded_at: Wed, 29 Aug 2012 03:23:02 GMT
61
+ - request:
62
+ method: get
63
+ uri: https://the-guide-staging.herokuapp.com/api/v1/websites/notfound
64
+ body:
65
+ encoding: US-ASCII
66
+ string: ''
67
+ headers:
68
+ Accept:
69
+ - application/json
70
+ Accept-Encoding:
71
+ - gzip, deflate
72
+ X-Reviewed-Authorization:
73
+ - '1234567890'
74
+ User-Agent:
75
+ - Ruby
76
+ response:
77
+ status:
78
+ code: 404
79
+ message: Not Found
80
+ headers:
81
+ Access-Control-Allow-Credentials:
82
+ - 'true'
83
+ Access-Control-Allow-Headers:
84
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
85
+ Content-Type
86
+ Access-Control-Allow-Methods:
87
+ - OPTIONS, GET, POST, PUT, DELETE
88
+ Access-Control-Allow-Origin:
89
+ - ! '*'
90
+ Access-Control-Max-Age:
91
+ - '1000'
92
+ Cache-Control:
93
+ - no-cache, no-store
94
+ Content-Type:
95
+ - application/json; charset=utf-8
96
+ Date:
97
+ - Wed, 29 Aug 2012 03:23:04 GMT
98
+ Server:
99
+ - thin 1.4.1 codename Chromeo
100
+ Strict-Transport-Security:
101
+ - max-age=31536000
102
+ X-Rack-Cache:
103
+ - miss
104
+ X-Rate-Limit:
105
+ - '100000'
106
+ X-Request-Id:
107
+ - 3f5c58e32843a701fc2d4d697aaeecb4
108
+ X-Runtime:
109
+ - '0.025829'
110
+ X-Ua-Compatible:
111
+ - IE=Edge,chrome=1
112
+ Content-Length:
113
+ - '30'
114
+ Connection:
115
+ - keep-alive
116
+ body:
117
+ encoding: US-ASCII
118
+ string: ! '{"message":"Record Not Found"}'
119
+ http_version:
120
+ recorded_at: Wed, 29 Aug 2012 03:23:02 GMT
121
+ - request:
122
+ method: get
123
+ uri: https://the-guide-staging.herokuapp.com/api/v1/articles/50241b9c5da4ac8d38000001
124
+ body:
125
+ encoding: US-ASCII
126
+ string: ''
127
+ headers:
128
+ Accept:
129
+ - application/json
130
+ Accept-Encoding:
131
+ - gzip, deflate
132
+ X-Reviewed-Authorization:
133
+ - xxxxxxxxxxxxxxxx
134
+ User-Agent:
135
+ - Ruby
136
+ response:
137
+ status:
138
+ code: 401
139
+ message: Unauthorized
140
+ headers:
141
+ Access-Control-Allow-Credentials:
142
+ - 'true'
143
+ Access-Control-Allow-Headers:
144
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
145
+ Content-Type
146
+ Access-Control-Allow-Methods:
147
+ - OPTIONS, GET, POST, PUT, DELETE
148
+ Access-Control-Allow-Origin:
149
+ - ! '*'
150
+ Access-Control-Max-Age:
151
+ - '1000'
152
+ Cache-Control:
153
+ - no-cache, no-store
154
+ Content-Type:
155
+ - application/json; charset=utf-8
156
+ Date:
157
+ - Wed, 29 Aug 2012 03:33:28 GMT
158
+ Server:
159
+ - thin 1.4.1 codename Chromeo
160
+ Strict-Transport-Security:
161
+ - max-age=31536000
162
+ X-Rack-Cache:
163
+ - miss
164
+ X-Request-Id:
165
+ - a12c938c839e21b1ec9e1cb77fcace26
166
+ X-Runtime:
167
+ - '0.150410'
168
+ X-Ua-Compatible:
169
+ - IE=Edge,chrome=1
170
+ Content-Length:
171
+ - '31'
172
+ Connection:
173
+ - keep-alive
174
+ body:
175
+ encoding: US-ASCII
176
+ string: ! '{"message":"Api Key not found"}'
177
+ http_version:
178
+ recorded_at: Wed, 29 Aug 2012 03:33:26 GMT
179
+ - request:
180
+ method: get
181
+ uri: https://the-guide-staging.herokuapp.com/api/v1/articles/notfound
182
+ body:
183
+ encoding: US-ASCII
184
+ string: ''
185
+ headers:
186
+ Accept:
187
+ - application/json
188
+ Accept-Encoding:
189
+ - gzip, deflate
190
+ X-Reviewed-Authorization:
191
+ - '1234567890'
192
+ User-Agent:
193
+ - Ruby
194
+ response:
195
+ status:
196
+ code: 404
197
+ message: Not Found
198
+ headers:
199
+ Access-Control-Allow-Credentials:
200
+ - 'true'
201
+ Access-Control-Allow-Headers:
202
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
203
+ Content-Type
204
+ Access-Control-Allow-Methods:
205
+ - OPTIONS, GET, POST, PUT, DELETE
206
+ Access-Control-Allow-Origin:
207
+ - ! '*'
208
+ Access-Control-Max-Age:
209
+ - '1000'
210
+ Cache-Control:
211
+ - no-cache, no-store
212
+ Content-Type:
213
+ - application/json; charset=utf-8
214
+ Date:
215
+ - Wed, 29 Aug 2012 03:33:28 GMT
216
+ Server:
217
+ - thin 1.4.1 codename Chromeo
218
+ Strict-Transport-Security:
219
+ - max-age=31536000
220
+ X-Rack-Cache:
221
+ - miss
222
+ X-Rate-Limit:
223
+ - '100000'
224
+ X-Request-Id:
225
+ - 05c47881cd83d03519f75042c5872568
226
+ X-Runtime:
227
+ - '0.173736'
228
+ X-Ua-Compatible:
229
+ - IE=Edge,chrome=1
230
+ Transfer-Encoding:
231
+ - chunked
232
+ Connection:
233
+ - keep-alive
234
+ body:
235
+ encoding: US-ASCII
236
+ string: ! '{"message":"Record Not Found"}'
237
+ http_version:
238
+ recorded_at: Wed, 29 Aug 2012 03:33:27 GMT
239
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,310 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://the-guide-staging.herokuapp.com/api/v1/websites/50241b9c5da4ac8d38000001
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ X-Reviewed-Authorization:
15
+ - '1234567890'
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 404
21
+ message: Not Found
22
+ headers:
23
+ Access-Control-Allow-Credentials:
24
+ - 'true'
25
+ Access-Control-Allow-Headers:
26
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
27
+ Content-Type
28
+ Access-Control-Allow-Methods:
29
+ - OPTIONS, GET, POST, PUT, DELETE
30
+ Access-Control-Allow-Origin:
31
+ - ! '*'
32
+ Access-Control-Max-Age:
33
+ - '1000'
34
+ Cache-Control:
35
+ - no-cache, no-store
36
+ Content-Type:
37
+ - application/json; charset=utf-8
38
+ Date:
39
+ - Wed, 29 Aug 2012 03:23:03 GMT
40
+ Server:
41
+ - thin 1.4.1 codename Chromeo
42
+ Strict-Transport-Security:
43
+ - max-age=31536000
44
+ X-Rack-Cache:
45
+ - miss
46
+ X-Rate-Limit:
47
+ - '100000'
48
+ X-Request-Id:
49
+ - 2b1844df21eb146f019f2b5275133202
50
+ X-Runtime:
51
+ - '0.281239'
52
+ X-Ua-Compatible:
53
+ - IE=Edge,chrome=1
54
+ Content-Length:
55
+ - '30'
56
+ Connection:
57
+ - keep-alive
58
+ body:
59
+ encoding: US-ASCII
60
+ string: ! '{"message":"Record Not Found"}'
61
+ http_version:
62
+ recorded_at: Wed, 29 Aug 2012 03:23:02 GMT
63
+ - request:
64
+ method: get
65
+ uri: https://the-guide-staging.herokuapp.com/api/v1/websites/5036c5f360de7d206500b11b
66
+ body:
67
+ encoding: US-ASCII
68
+ string: ''
69
+ headers:
70
+ Accept:
71
+ - application/json
72
+ Accept-Encoding:
73
+ - gzip, deflate
74
+ X-Reviewed-Authorization:
75
+ - '1234567890'
76
+ User-Agent:
77
+ - Ruby
78
+ response:
79
+ status:
80
+ code: 404
81
+ message: Not Found
82
+ headers:
83
+ Access-Control-Allow-Credentials:
84
+ - 'true'
85
+ Access-Control-Allow-Headers:
86
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
87
+ Content-Type
88
+ Access-Control-Allow-Methods:
89
+ - OPTIONS, GET, POST, PUT, DELETE
90
+ Access-Control-Allow-Origin:
91
+ - ! '*'
92
+ Access-Control-Max-Age:
93
+ - '1000'
94
+ Cache-Control:
95
+ - no-cache, no-store
96
+ Content-Type:
97
+ - application/json; charset=utf-8
98
+ Date:
99
+ - Wed, 29 Aug 2012 03:27:06 GMT
100
+ Server:
101
+ - thin 1.4.1 codename Chromeo
102
+ Strict-Transport-Security:
103
+ - max-age=31536000
104
+ X-Rack-Cache:
105
+ - miss
106
+ X-Rate-Limit:
107
+ - '100000'
108
+ X-Request-Id:
109
+ - 9576ed2454a30ccd554414ee496dc99a
110
+ X-Runtime:
111
+ - '0.976992'
112
+ X-Ua-Compatible:
113
+ - IE=Edge,chrome=1
114
+ Transfer-Encoding:
115
+ - chunked
116
+ Connection:
117
+ - keep-alive
118
+ body:
119
+ encoding: US-ASCII
120
+ string: ! '{"message":"Record Not Found"}'
121
+ http_version:
122
+ recorded_at: Wed, 29 Aug 2012 03:27:05 GMT
123
+ - request:
124
+ method: get
125
+ uri: https://the-guide-staging.herokuapp.com/api/v1/articles/5036c5f360de7d206500b11b
126
+ body:
127
+ encoding: US-ASCII
128
+ string: ''
129
+ headers:
130
+ Accept:
131
+ - application/json
132
+ Accept-Encoding:
133
+ - gzip, deflate
134
+ X-Reviewed-Authorization:
135
+ - '1234567890'
136
+ User-Agent:
137
+ - Ruby
138
+ response:
139
+ status:
140
+ code: 404
141
+ message: Not Found
142
+ headers:
143
+ Access-Control-Allow-Credentials:
144
+ - 'true'
145
+ Access-Control-Allow-Headers:
146
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
147
+ Content-Type
148
+ Access-Control-Allow-Methods:
149
+ - OPTIONS, GET, POST, PUT, DELETE
150
+ Access-Control-Allow-Origin:
151
+ - ! '*'
152
+ Access-Control-Max-Age:
153
+ - '1000'
154
+ Cache-Control:
155
+ - no-cache, no-store
156
+ Content-Type:
157
+ - application/json; charset=utf-8
158
+ Date:
159
+ - Wed, 29 Aug 2012 03:33:27 GMT
160
+ Server:
161
+ - thin 1.4.1 codename Chromeo
162
+ Strict-Transport-Security:
163
+ - max-age=31536000
164
+ X-Rack-Cache:
165
+ - miss
166
+ X-Rate-Limit:
167
+ - '100000'
168
+ X-Request-Id:
169
+ - 3626ec9e771f5b6531cddb5c2c3b02fe
170
+ X-Runtime:
171
+ - '0.774739'
172
+ X-Ua-Compatible:
173
+ - IE=Edge,chrome=1
174
+ Transfer-Encoding:
175
+ - chunked
176
+ Connection:
177
+ - keep-alive
178
+ body:
179
+ encoding: US-ASCII
180
+ string: ! '{"message":"Record Not Found"}'
181
+ http_version:
182
+ recorded_at: Wed, 29 Aug 2012 03:33:26 GMT
183
+ - request:
184
+ method: get
185
+ uri: https://the-guide-staging.herokuapp.com/api/v1/articles/50241b9c5da4ac8d38000001
186
+ body:
187
+ encoding: US-ASCII
188
+ string: ''
189
+ headers:
190
+ Accept:
191
+ - application/json
192
+ Accept-Encoding:
193
+ - gzip, deflate
194
+ X-Reviewed-Authorization:
195
+ - '1234567890'
196
+ User-Agent:
197
+ - Ruby
198
+ response:
199
+ status:
200
+ code: 404
201
+ message: Not Found
202
+ headers:
203
+ Access-Control-Allow-Credentials:
204
+ - 'true'
205
+ Access-Control-Allow-Headers:
206
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
207
+ Content-Type
208
+ Access-Control-Allow-Methods:
209
+ - OPTIONS, GET, POST, PUT, DELETE
210
+ Access-Control-Allow-Origin:
211
+ - ! '*'
212
+ Access-Control-Max-Age:
213
+ - '1000'
214
+ Cache-Control:
215
+ - no-cache, no-store
216
+ Content-Type:
217
+ - application/json; charset=utf-8
218
+ Date:
219
+ - Wed, 29 Aug 2012 03:33:27 GMT
220
+ Server:
221
+ - thin 1.4.1 codename Chromeo
222
+ Strict-Transport-Security:
223
+ - max-age=31536000
224
+ X-Rack-Cache:
225
+ - miss
226
+ X-Rate-Limit:
227
+ - '100000'
228
+ X-Request-Id:
229
+ - 57afd1f76da45c6f5150018b5bddd456
230
+ X-Runtime:
231
+ - '0.074553'
232
+ X-Ua-Compatible:
233
+ - IE=Edge,chrome=1
234
+ Transfer-Encoding:
235
+ - chunked
236
+ Connection:
237
+ - keep-alive
238
+ body:
239
+ encoding: US-ASCII
240
+ string: ! '{"message":"Record Not Found"}'
241
+ http_version:
242
+ recorded_at: Wed, 29 Aug 2012 03:33:26 GMT
243
+ - request:
244
+ method: get
245
+ uri: https://the-guide-staging.herokuapp.com/api/v1/articles/5036d7dd60de7d2065075752
246
+ body:
247
+ encoding: US-ASCII
248
+ string: ''
249
+ headers:
250
+ Accept:
251
+ - application/json
252
+ Accept-Encoding:
253
+ - gzip, deflate
254
+ X-Reviewed-Authorization:
255
+ - '1234567890'
256
+ User-Agent:
257
+ - Ruby
258
+ response:
259
+ status:
260
+ code: 200
261
+ message: OK
262
+ headers:
263
+ Access-Control-Allow-Credentials:
264
+ - 'true'
265
+ Access-Control-Allow-Headers:
266
+ - x-pagination, x-requested-with, x-requested-by, x-reviewed-authorization,
267
+ Content-Type
268
+ Access-Control-Allow-Methods:
269
+ - OPTIONS, GET, POST, PUT, DELETE
270
+ Access-Control-Allow-Origin:
271
+ - ! '*'
272
+ Access-Control-Max-Age:
273
+ - '1000'
274
+ Cache-Control:
275
+ - no-cache, no-store
276
+ Content-Type:
277
+ - application/json; charset=utf-8
278
+ Date:
279
+ - Wed, 29 Aug 2012 03:38:18 GMT
280
+ Etag:
281
+ - ! '"d89d1b0cf945ef53c59fca6065e56759"'
282
+ Server:
283
+ - thin 1.4.1 codename Chromeo
284
+ Strict-Transport-Security:
285
+ - max-age=31536000
286
+ X-Rack-Cache:
287
+ - miss
288
+ X-Rate-Limit:
289
+ - '100000'
290
+ X-Request-Id:
291
+ - 388c5ebc8e18e6aecc413b84bd5ebc61
292
+ X-Runtime:
293
+ - '0.060404'
294
+ X-Ua-Compatible:
295
+ - IE=Edge,chrome=1
296
+ Transfer-Encoding:
297
+ - chunked
298
+ Connection:
299
+ - keep-alive
300
+ body:
301
+ encoding: US-ASCII
302
+ string: ! '{"id":"5036d7dd60de7d2065075752","name":"Fast Appliances To Save
303
+ You Time","slug":"fast-appliances-to-save-you-time","summary":null,"website_ids":["5033da7960de7d6457000011"],"tags":["Feature"],"created_at":"2012-08-09T16:33:14Z","updated_at":"2012-08-14T18:44:41Z","pages":[],"products":[],"authors":[{"id":"5036f36360de7d6716000099","name":"Keith
304
+ Barry","title":"Editor","short_bio":" This is the default bio for a author.
305
+ It can be edited\n in the defaults.rb configatron file.\n","long_bio":" This
306
+ is the default bio for a author. It can be edited\n in the defaults.rb configatron
307
+ file.\n","created_at":"2012-08-24T03:22:11Z","updated_at":"2012-08-24T03:22:11Z","social":{"email":"kbarry@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/5d65db5a750abb45284896865c5c1446?s=48&d=mm","medium":"http://www.gravatar.com/avatar/5d65db5a750abb45284896865c5c1446?s=128&d=mm","normal":"http://www.gravatar.com/avatar/5d65db5a750abb45284896865c5c1446?d=mm"},"permissions":{"manage":true,"read":true,"create":true,"update":true,"destroy":true}}],"attachments":[],"permissions":{"manage":true,"read":true,"create":true,"update":true,"destroy":true}}'
308
+ http_version:
309
+ recorded_at: Wed, 29 Aug 2012 03:38:16 GMT
310
+ recorded_with: VCR 2.2.4