reviewed 0.0.1

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.
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,84 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://the-guide-staging.herokuapp.com/api/v1/products/medium-green-charcoal
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: 200
21
+ message: OK
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
+ - Fri, 07 Sep 2012 16:05:30 GMT
40
+ Last-Modified:
41
+ - Wed, 05 Sep 2012 17:53:39 GMT
42
+ Server:
43
+ - thin 1.4.1 codename Chromeo
44
+ Strict-Transport-Security:
45
+ - max-age=31536000
46
+ X-Rack-Cache:
47
+ - miss
48
+ X-Rate-Limit:
49
+ - '100000'
50
+ X-Request-Id:
51
+ - a09dc855659679b4c21e788f1a3d165e
52
+ X-Runtime:
53
+ - '0.095892'
54
+ X-Ua-Compatible:
55
+ - IE=Edge,chrome=1
56
+ Transfer-Encoding:
57
+ - chunked
58
+ Connection:
59
+ - keep-alive
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ! '{"id":"503eb5038fd4f58eaf310c21","name":"Medium Green / Charcoal","slug":"medium-green-charcoal","_type":"Home::Grills::Charcoal","types":[],"product_rating":4.79,"ranking":{"total":60,"rank":3},"msrp":null,"manufacturer_specs":{"brand_name":"(Big
63
+ Green Egg)","manufacturer_name":"Big Green Egg","manual_url":"","manual_text":"","manufacturer_text":null,"manufacturer_url":"","series_name":"","publishable_on":"2011-10-12T18:55:00Z","Fuel":["Charcoal"],"Install
64
+ Type":"Freestanding","Total cooking area":177.0,"Finish or Color":"Green","Ignition
65
+ type":"Manual","Side Burner":"No","Rotisserie":"No","Original Price":649.0},"article_ids":["504563ee60de7d97ec000341"],"created_at":"2011-10-12T18:55:14Z","updated_at":"2012-09-05T17:53:39Z","attachments":[{"id":"504563ee60de7d97ec00039e","name":"BGE-medium-web1.jpg","type":"image","content_type":"image/jpeg","file_size":81744,"tags":["Vanity"],"url":"https://s3.amazonaws.com/staging.reviewed.attachments/attachment/63583c1baea391b437d54fbee74bc35234ec3ff2/BGE-medium-web1.jpg","permissions":{"manage":true,"read":true,"create":true,"update":true,"destroy":true}},{"id":"504563ee60de7d97ec00039f","name":"BGE-medium-web2.jpg","type":"image","content_type":"image/jpeg","file_size":81744,"tags":["Hero"],"url":"https://s3.amazonaws.com/staging.reviewed.attachments/attachment/63583c1baea391b437d54fbee74bc35234ec3ff2/BGE-medium-web2.jpg","permissions":{"manage":true,"read":true,"create":true,"update":true,"destroy":true}}],"brand":null,"raw_scores":{"Heatup
66
+ Time Rating":{"value":15.0,"weight":10.0},"Low Temp Performance Rating":{"value":8.84,"weight":12.5},"Low
67
+ Temp Uniformity Rating":{"value":8.9,"weight":2.5},"Low Temp Consistency Rating":{"value":8.5,"weight":2.5},"High
68
+ Temp Performance Rating":{"value":12.19,"weight":12.5},"High Temp Uniformity
69
+ Rating":{"value":4.97,"weight":2.5},"High Temp Consistency Rating":{"value":1.63,"weight":2.5},"Warming
70
+ Performance Rating":{"value":0.0,"weight":5.0},"Construction Rating":{"value":7.95,"weight":2.5},"Controls
71
+ Rating":{"value":1.0,"weight":10.0},"Fuel Rating":{"value":4.0,"weight":5.0},"Lighter
72
+ Rating":{"value":0.0,"weight":5.0},"Cooking Area Rating":{"value":8.99,"weight":10.0},"Warming
73
+ Area Rating":{"value":0.0,"weight":2.5},"Cleanup Rating":{"value":7.0,"weight":5.0},"Case
74
+ Heat Rating":{"value":13.31,"weight":5.0},"Other Features Rating":{"value":0.0,"weight":5.0},"Other
75
+ Areas Rating":{"value":0.0,"weight":2.5}},"scaled_scores":{"Heatup Time Rating":4.17,"Low
76
+ Temp Performance Rating":8.12,"Low Temp Uniformity Rating":7.16,"Low Temp
77
+ Consistency Rating":4.17,"High Temp Performance Rating":10.0,"High Temp Uniformity
78
+ Rating":0.0,"High Temp Consistency Rating":0.0,"Warming Performance Rating":0.0,"Construction
79
+ Rating":0.0,"Controls Rating":1.0,"Fuel Rating":1.43,"Lighter Rating":0.0,"Cooking
80
+ Area Rating":0.0,"Warming Area Rating":0.0,"Cleanup Rating":2.5,"Case Heat
81
+ Rating":10.0,"Other Features Rating":0.0,"Other Areas Rating":0.0},"rateable":"rateable","rateable?":true,"permissions":{"manage":true,"read":true,"create":true,"update":true,"destroy":true}}'
82
+ http_version:
83
+ recorded_at: Fri, 07 Sep 2012 16:05:31 GMT
84
+ recorded_with: VCR 2.2.4
@@ -0,0 +1,144 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://the-guide-staging.herokuapp.com/api/v1/authors
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: 200
21
+ message: OK
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
+ - Tue, 02 Oct 2012 18:40:39 GMT
40
+ Etag:
41
+ - ! '"f79d99e2a0a99f3f72f228d9d759a42e"'
42
+ Server:
43
+ - thin 1.5.0 codename Knife
44
+ Strict-Transport-Security:
45
+ - max-age=31536000
46
+ X-Rack-Cache:
47
+ - miss
48
+ X-Rate-Limit:
49
+ - '99964'
50
+ X-Request-Id:
51
+ - 5435026589868297a18c94ba41e5001a
52
+ X-Runtime:
53
+ - '1.145154'
54
+ X-Ua-Compatible:
55
+ - IE=Edge,chrome=1
56
+ Transfer-Encoding:
57
+ - chunked
58
+ Connection:
59
+ - keep-alive
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ! '{"pagination":{"total":171,"total_pages":9,"first_page":true,"last_page":false,"previous_page":null,"next_page":2,"out_of_bounds":false,"offset":0,"current_page":1,"per_page":20,"entries_on_page":20},"data":[{"id":"506b0bfebd02862270001329","created_at":"2012-10-02T15:45:02Z","updated_at":"2012-10-02T15:45:02Z","name":"Ben
63
+ Keough","title":"Editor","short_bio":"This is the default bio for a author.
64
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
65
+ is the default bio for a author. It can be edited in the defaults.rb configatron
66
+ file.\n","slug":"ben-keough","social":{"email":"bkeough@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/c3ef0cecaccbc869b8977e181442a646?s=48&d=mm","medium":"http://www.gravatar.com/avatar/c3ef0cecaccbc869b8977e181442a646?s=128&d=mm","normal":"http://www.gravatar.com/avatar/c3ef0cecaccbc869b8977e181442a646?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001328","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:02Z","name":"Michael
67
+ T. Ruhl","title":"Editor","short_bio":"This is the default bio for a author.
68
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
69
+ is the default bio for a author. It can be edited in the defaults.rb configatron
70
+ file.\n","slug":"michael-t-ruhl","social":{"email":"mruhl@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/a78693f1b3829300ba96bc7eecc0d889?s=48&d=mm","medium":"http://www.gravatar.com/avatar/a78693f1b3829300ba96bc7eecc0d889?s=128&d=mm","normal":"http://www.gravatar.com/avatar/a78693f1b3829300ba96bc7eecc0d889?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001327","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Ethan
71
+ Wolff-Mann","title":"Editor","short_bio":"This is the default bio for a author.
72
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
73
+ is the default bio for a author. It can be edited in the defaults.rb configatron
74
+ file.\n","slug":"ethan-wolff-mann","social":{"email":"emann@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/7c6de3e830cfa67cdbcd8bed0364befb?s=48&d=mm","medium":"http://www.gravatar.com/avatar/7c6de3e830cfa67cdbcd8bed0364befb?s=128&d=mm","normal":"http://www.gravatar.com/avatar/7c6de3e830cfa67cdbcd8bed0364befb?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001326","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"James
75
+ Johnston","title":"Editor","short_bio":"This is the default bio for a author.
76
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
77
+ is the default bio for a author. It can be edited in the defaults.rb configatron
78
+ file.\n","slug":"james-johnston","social":{"email":"jj.johnston2@comcast.net"},"avatars":{"small":"http://www.gravatar.com/avatar/685359c9e6882600645bf66a432eea55?s=48&d=mm","medium":"http://www.gravatar.com/avatar/685359c9e6882600645bf66a432eea55?s=128&d=mm","normal":"http://www.gravatar.com/avatar/685359c9e6882600645bf66a432eea55?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001325","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Mike
79
+ Roorda","title":"Editor","short_bio":"This is the default bio for a author.
80
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
81
+ is the default bio for a author. It can be edited in the defaults.rb configatron
82
+ file.\n","slug":"mike-roorda","social":{"email":"mroorda@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/7a6d40d47cc53e46807f6a6c40af58ab?s=48&d=mm","medium":"http://www.gravatar.com/avatar/7a6d40d47cc53e46807f6a6c40af58ab?s=128&d=mm","normal":"http://www.gravatar.com/avatar/7a6d40d47cc53e46807f6a6c40af58ab?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001324","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Tyler
83
+ Wells Lynch","title":"Editor","short_bio":"This is the default bio for a author.
84
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
85
+ is the default bio for a author. It can be edited in the defaults.rb configatron
86
+ file.\n","slug":"tyler-wells-lynch","social":{"email":"tlynch@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/15f94920513f045bd68d25ed796c75f0?s=48&d=mm","medium":"http://www.gravatar.com/avatar/15f94920513f045bd68d25ed796c75f0?s=128&d=mm","normal":"http://www.gravatar.com/avatar/15f94920513f045bd68d25ed796c75f0?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001323","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Josh
87
+ Fields","title":"Editor","short_bio":"This is the default bio for a author.
88
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
89
+ is the default bio for a author. It can be edited in the defaults.rb configatron
90
+ file.\n","slug":"josh-fields","social":{"email":"jfields@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/4316abf7ae494fb4f93c67a8507c4b29?s=48&d=mm","medium":"http://www.gravatar.com/avatar/4316abf7ae494fb4f93c67a8507c4b29?s=128&d=mm","normal":"http://www.gravatar.com/avatar/4316abf7ae494fb4f93c67a8507c4b29?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd02862270001322","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:01Z","name":"Jonathan
91
+ Chan","title":"Editor","short_bio":"This is the default bio for a author.
92
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
93
+ is the default bio for a author. It can be edited in the defaults.rb configatron
94
+ file.\n","slug":"jonathan-chan","social":{"email":"jchan@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/8bd9e016c51a0a5be4923601e53df618?s=48&d=mm","medium":"http://www.gravatar.com/avatar/8bd9e016c51a0a5be4923601e53df618?s=128&d=mm","normal":"http://www.gravatar.com/avatar/8bd9e016c51a0a5be4923601e53df618?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd02862270001321","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Matthew
95
+ Zahnzinger","title":"Editor","short_bio":"This is the default bio for a author.
96
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
97
+ is the default bio for a author. It can be edited in the defaults.rb configatron
98
+ file.\n","slug":"matthew-zahnzinger","social":{"email":"mzahnzinger@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/8eb9a81dddcabe7db217ee3f3a202f39?s=48&d=mm","medium":"http://www.gravatar.com/avatar/8eb9a81dddcabe7db217ee3f3a202f39?s=128&d=mm","normal":"http://www.gravatar.com/avatar/8eb9a81dddcabe7db217ee3f3a202f39?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd02862270001320","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Lee
99
+ Neikirk","title":"Editor","short_bio":"This is the default bio for a author.
100
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
101
+ is the default bio for a author. It can be edited in the defaults.rb configatron
102
+ file.\n","slug":"lee-neikirk","social":{"email":"lneikirk@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/499082ae2166f577cbc10d2f98544ffd?s=48&d=mm","medium":"http://www.gravatar.com/avatar/499082ae2166f577cbc10d2f98544ffd?s=128&d=mm","normal":"http://www.gravatar.com/avatar/499082ae2166f577cbc10d2f98544ffd?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131f","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"David
103
+ Swanson","title":"Editor","short_bio":"This is the default bio for a author.
104
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
105
+ is the default bio for a author. It can be edited in the defaults.rb configatron
106
+ file.\n","slug":"david-swanson","social":{"email":"dswanson@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/97f2acf1588d850f27920785892965f6?s=48&d=mm","medium":"http://www.gravatar.com/avatar/97f2acf1588d850f27920785892965f6?s=128&d=mm","normal":"http://www.gravatar.com/avatar/97f2acf1588d850f27920785892965f6?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131e","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Patrick
107
+ Ouellette","title":"Editor","short_bio":"This is the default bio for a author.
108
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
109
+ is the default bio for a author. It can be edited in the defaults.rb configatron
110
+ file.\n","slug":"patrick-ouellette","social":{"email":"pouellette@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/9e8667a1574b61a605bcae15b94f78b3?s=48&d=mm","medium":"http://www.gravatar.com/avatar/9e8667a1574b61a605bcae15b94f78b3?s=128&d=mm","normal":"http://www.gravatar.com/avatar/9e8667a1574b61a605bcae15b94f78b3?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131d","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Gene
111
+ Sloan","title":"Editor","short_bio":"This is the default bio for a author.
112
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
113
+ is the default bio for a author. It can be edited in the defaults.rb configatron
114
+ file.\n","slug":"gene-sloan","social":{"email":"gsloan@usatoday.com"},"avatars":{"small":"http://www.gravatar.com/avatar/33027cac59dd6b8930091bda94b85da7?s=48&d=mm","medium":"http://www.gravatar.com/avatar/33027cac59dd6b8930091bda94b85da7?s=128&d=mm","normal":"http://www.gravatar.com/avatar/33027cac59dd6b8930091bda94b85da7?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131c","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Liam
115
+ McCabe","title":"Editor","short_bio":"This is the default bio for a author.
116
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
117
+ is the default bio for a author. It can be edited in the defaults.rb configatron
118
+ file.\n","slug":"liam-mccabe","social":{"email":"lmccabe@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/09bf69f5c0b7e9b71014ed194b1f4764?s=48&d=mm","medium":"http://www.gravatar.com/avatar/09bf69f5c0b7e9b71014ed194b1f4764?s=128&d=mm","normal":"http://www.gravatar.com/avatar/09bf69f5c0b7e9b71014ed194b1f4764?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd0286227000131b","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Anonymous","title":"Editor","short_bio":"This
119
+ is the default bio for a author. It can be edited in the defaults.rb configatron
120
+ file.\n","long_bio":"This is the default bio for a author. It can be edited
121
+ in the defaults.rb configatron file.\n","slug":"anonymous","social":{"email":"electricflux@live.com"},"avatars":{"small":"http://www.gravatar.com/avatar/7362890f3cd028c5d4f757bedae2fd94?s=48&d=mm","medium":"http://www.gravatar.com/avatar/7362890f3cd028c5d4f757bedae2fd94?s=128&d=mm","normal":"http://www.gravatar.com/avatar/7362890f3cd028c5d4f757bedae2fd94?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd0286227000131a","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Christian
122
+ Sherden","title":"Editor","short_bio":"This is the default bio for a author.
123
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
124
+ is the default bio for a author. It can be edited in the defaults.rb configatron
125
+ file.\n","slug":"christian-sherden","social":{"email":"csherden@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/550984f6a0350bb06435c587a6a7296d?s=48&d=mm","medium":"http://www.gravatar.com/avatar/550984f6a0350bb06435c587a6a7296d?s=128&d=mm","normal":"http://www.gravatar.com/avatar/550984f6a0350bb06435c587a6a7296d?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd02862270001319","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Luke
126
+ Bergen","title":"Editor","short_bio":"This is the default bio for a author.
127
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
128
+ is the default bio for a author. It can be edited in the defaults.rb configatron
129
+ file.\n","slug":"luke-bergen","social":{"email":"lbergen@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/2525364bec7b6147fd21f4796dd7f471?s=48&d=mm","medium":"http://www.gravatar.com/avatar/2525364bec7b6147fd21f4796dd7f471?s=128&d=mm","normal":"http://www.gravatar.com/avatar/2525364bec7b6147fd21f4796dd7f471?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd02862270001318","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Christopher
130
+ Snow","title":"Editor","short_bio":"This is the default bio for a author.
131
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
132
+ is the default bio for a author. It can be edited in the defaults.rb configatron
133
+ file.\n","slug":"christopher-snow","social":{"email":"csnow@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/4e2a6a416de4c975a60c432a6c44491d?s=48&d=mm","medium":"http://www.gravatar.com/avatar/4e2a6a416de4c975a60c432a6c44491d?s=128&d=mm","normal":"http://www.gravatar.com/avatar/4e2a6a416de4c975a60c432a6c44491d?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd02862270001317","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Keith
134
+ Barry","title":"Editor","short_bio":"This is the default bio for a author.
135
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
136
+ is the default bio for a author. It can be edited in the defaults.rb configatron
137
+ file.\n","slug":"keith-barry","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":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfabd02862270001316","created_at":"2012-10-02T15:44:58Z","updated_at":"2012-10-02T15:44:59Z","name":"Chris
138
+ Thomas","title":"Editor","short_bio":"This is the default bio for a author.
139
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
140
+ is the default bio for a author. It can be edited in the defaults.rb configatron
141
+ file.\n","slug":"chris-thomas","social":{"email":"cthomas@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/29e724ec29940a903e976cf3e5536e08?s=48&d=mm","medium":"http://www.gravatar.com/avatar/29e724ec29940a903e976cf3e5536e08?s=128&d=mm","normal":"http://www.gravatar.com/avatar/29e724ec29940a903e976cf3e5536e08?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}}]}'
142
+ http_version:
143
+ recorded_at: Tue, 02 Oct 2012 18:40:29 GMT
144
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,144 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://the-guide-staging.herokuapp.com/api/v1/authors
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: 200
21
+ message: OK
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
+ - Tue, 02 Oct 2012 19:07:19 GMT
40
+ Etag:
41
+ - ! '"f79d99e2a0a99f3f72f228d9d759a42e"'
42
+ Server:
43
+ - thin 1.5.0 codename Knife
44
+ Strict-Transport-Security:
45
+ - max-age=31536000
46
+ X-Rack-Cache:
47
+ - miss
48
+ X-Rate-Limit:
49
+ - '99999'
50
+ X-Request-Id:
51
+ - e33d5590a53df5d55434f336a3d34a8f
52
+ X-Runtime:
53
+ - '0.356420'
54
+ X-Ua-Compatible:
55
+ - IE=Edge,chrome=1
56
+ Transfer-Encoding:
57
+ - chunked
58
+ Connection:
59
+ - keep-alive
60
+ body:
61
+ encoding: US-ASCII
62
+ string: ! '{"pagination":{"total":171,"total_pages":9,"first_page":true,"last_page":false,"previous_page":null,"next_page":2,"out_of_bounds":false,"offset":0,"current_page":1,"per_page":20,"entries_on_page":20},"data":[{"id":"506b0bfebd02862270001329","created_at":"2012-10-02T15:45:02Z","updated_at":"2012-10-02T15:45:02Z","name":"Ben
63
+ Keough","title":"Editor","short_bio":"This is the default bio for a author.
64
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
65
+ is the default bio for a author. It can be edited in the defaults.rb configatron
66
+ file.\n","slug":"ben-keough","social":{"email":"bkeough@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/c3ef0cecaccbc869b8977e181442a646?s=48&d=mm","medium":"http://www.gravatar.com/avatar/c3ef0cecaccbc869b8977e181442a646?s=128&d=mm","normal":"http://www.gravatar.com/avatar/c3ef0cecaccbc869b8977e181442a646?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001328","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:02Z","name":"Michael
67
+ T. Ruhl","title":"Editor","short_bio":"This is the default bio for a author.
68
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
69
+ is the default bio for a author. It can be edited in the defaults.rb configatron
70
+ file.\n","slug":"michael-t-ruhl","social":{"email":"mruhl@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/a78693f1b3829300ba96bc7eecc0d889?s=48&d=mm","medium":"http://www.gravatar.com/avatar/a78693f1b3829300ba96bc7eecc0d889?s=128&d=mm","normal":"http://www.gravatar.com/avatar/a78693f1b3829300ba96bc7eecc0d889?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001327","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Ethan
71
+ Wolff-Mann","title":"Editor","short_bio":"This is the default bio for a author.
72
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
73
+ is the default bio for a author. It can be edited in the defaults.rb configatron
74
+ file.\n","slug":"ethan-wolff-mann","social":{"email":"emann@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/7c6de3e830cfa67cdbcd8bed0364befb?s=48&d=mm","medium":"http://www.gravatar.com/avatar/7c6de3e830cfa67cdbcd8bed0364befb?s=128&d=mm","normal":"http://www.gravatar.com/avatar/7c6de3e830cfa67cdbcd8bed0364befb?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001326","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"James
75
+ Johnston","title":"Editor","short_bio":"This is the default bio for a author.
76
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
77
+ is the default bio for a author. It can be edited in the defaults.rb configatron
78
+ file.\n","slug":"james-johnston","social":{"email":"jj.johnston2@comcast.net"},"avatars":{"small":"http://www.gravatar.com/avatar/685359c9e6882600645bf66a432eea55?s=48&d=mm","medium":"http://www.gravatar.com/avatar/685359c9e6882600645bf66a432eea55?s=128&d=mm","normal":"http://www.gravatar.com/avatar/685359c9e6882600645bf66a432eea55?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001325","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Mike
79
+ Roorda","title":"Editor","short_bio":"This is the default bio for a author.
80
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
81
+ is the default bio for a author. It can be edited in the defaults.rb configatron
82
+ file.\n","slug":"mike-roorda","social":{"email":"mroorda@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/7a6d40d47cc53e46807f6a6c40af58ab?s=48&d=mm","medium":"http://www.gravatar.com/avatar/7a6d40d47cc53e46807f6a6c40af58ab?s=128&d=mm","normal":"http://www.gravatar.com/avatar/7a6d40d47cc53e46807f6a6c40af58ab?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001324","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Tyler
83
+ Wells Lynch","title":"Editor","short_bio":"This is the default bio for a author.
84
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
85
+ is the default bio for a author. It can be edited in the defaults.rb configatron
86
+ file.\n","slug":"tyler-wells-lynch","social":{"email":"tlynch@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/15f94920513f045bd68d25ed796c75f0?s=48&d=mm","medium":"http://www.gravatar.com/avatar/15f94920513f045bd68d25ed796c75f0?s=128&d=mm","normal":"http://www.gravatar.com/avatar/15f94920513f045bd68d25ed796c75f0?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfdbd02862270001323","created_at":"2012-10-02T15:45:01Z","updated_at":"2012-10-02T15:45:01Z","name":"Josh
87
+ Fields","title":"Editor","short_bio":"This is the default bio for a author.
88
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
89
+ is the default bio for a author. It can be edited in the defaults.rb configatron
90
+ file.\n","slug":"josh-fields","social":{"email":"jfields@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/4316abf7ae494fb4f93c67a8507c4b29?s=48&d=mm","medium":"http://www.gravatar.com/avatar/4316abf7ae494fb4f93c67a8507c4b29?s=128&d=mm","normal":"http://www.gravatar.com/avatar/4316abf7ae494fb4f93c67a8507c4b29?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd02862270001322","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:01Z","name":"Jonathan
91
+ Chan","title":"Editor","short_bio":"This is the default bio for a author.
92
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
93
+ is the default bio for a author. It can be edited in the defaults.rb configatron
94
+ file.\n","slug":"jonathan-chan","social":{"email":"jchan@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/8bd9e016c51a0a5be4923601e53df618?s=48&d=mm","medium":"http://www.gravatar.com/avatar/8bd9e016c51a0a5be4923601e53df618?s=128&d=mm","normal":"http://www.gravatar.com/avatar/8bd9e016c51a0a5be4923601e53df618?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd02862270001321","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Matthew
95
+ Zahnzinger","title":"Editor","short_bio":"This is the default bio for a author.
96
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
97
+ is the default bio for a author. It can be edited in the defaults.rb configatron
98
+ file.\n","slug":"matthew-zahnzinger","social":{"email":"mzahnzinger@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/8eb9a81dddcabe7db217ee3f3a202f39?s=48&d=mm","medium":"http://www.gravatar.com/avatar/8eb9a81dddcabe7db217ee3f3a202f39?s=128&d=mm","normal":"http://www.gravatar.com/avatar/8eb9a81dddcabe7db217ee3f3a202f39?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd02862270001320","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Lee
99
+ Neikirk","title":"Editor","short_bio":"This is the default bio for a author.
100
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
101
+ is the default bio for a author. It can be edited in the defaults.rb configatron
102
+ file.\n","slug":"lee-neikirk","social":{"email":"lneikirk@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/499082ae2166f577cbc10d2f98544ffd?s=48&d=mm","medium":"http://www.gravatar.com/avatar/499082ae2166f577cbc10d2f98544ffd?s=128&d=mm","normal":"http://www.gravatar.com/avatar/499082ae2166f577cbc10d2f98544ffd?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131f","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"David
103
+ Swanson","title":"Editor","short_bio":"This is the default bio for a author.
104
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
105
+ is the default bio for a author. It can be edited in the defaults.rb configatron
106
+ file.\n","slug":"david-swanson","social":{"email":"dswanson@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/97f2acf1588d850f27920785892965f6?s=48&d=mm","medium":"http://www.gravatar.com/avatar/97f2acf1588d850f27920785892965f6?s=128&d=mm","normal":"http://www.gravatar.com/avatar/97f2acf1588d850f27920785892965f6?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131e","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Patrick
107
+ Ouellette","title":"Editor","short_bio":"This is the default bio for a author.
108
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
109
+ is the default bio for a author. It can be edited in the defaults.rb configatron
110
+ file.\n","slug":"patrick-ouellette","social":{"email":"pouellette@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/9e8667a1574b61a605bcae15b94f78b3?s=48&d=mm","medium":"http://www.gravatar.com/avatar/9e8667a1574b61a605bcae15b94f78b3?s=128&d=mm","normal":"http://www.gravatar.com/avatar/9e8667a1574b61a605bcae15b94f78b3?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131d","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Gene
111
+ Sloan","title":"Editor","short_bio":"This is the default bio for a author.
112
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
113
+ is the default bio for a author. It can be edited in the defaults.rb configatron
114
+ file.\n","slug":"gene-sloan","social":{"email":"gsloan@usatoday.com"},"avatars":{"small":"http://www.gravatar.com/avatar/33027cac59dd6b8930091bda94b85da7?s=48&d=mm","medium":"http://www.gravatar.com/avatar/33027cac59dd6b8930091bda94b85da7?s=128&d=mm","normal":"http://www.gravatar.com/avatar/33027cac59dd6b8930091bda94b85da7?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfcbd0286227000131c","created_at":"2012-10-02T15:45:00Z","updated_at":"2012-10-02T15:45:00Z","name":"Liam
115
+ McCabe","title":"Editor","short_bio":"This is the default bio for a author.
116
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
117
+ is the default bio for a author. It can be edited in the defaults.rb configatron
118
+ file.\n","slug":"liam-mccabe","social":{"email":"lmccabe@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/09bf69f5c0b7e9b71014ed194b1f4764?s=48&d=mm","medium":"http://www.gravatar.com/avatar/09bf69f5c0b7e9b71014ed194b1f4764?s=128&d=mm","normal":"http://www.gravatar.com/avatar/09bf69f5c0b7e9b71014ed194b1f4764?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd0286227000131b","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Anonymous","title":"Editor","short_bio":"This
119
+ is the default bio for a author. It can be edited in the defaults.rb configatron
120
+ file.\n","long_bio":"This is the default bio for a author. It can be edited
121
+ in the defaults.rb configatron file.\n","slug":"anonymous","social":{"email":"electricflux@live.com"},"avatars":{"small":"http://www.gravatar.com/avatar/7362890f3cd028c5d4f757bedae2fd94?s=48&d=mm","medium":"http://www.gravatar.com/avatar/7362890f3cd028c5d4f757bedae2fd94?s=128&d=mm","normal":"http://www.gravatar.com/avatar/7362890f3cd028c5d4f757bedae2fd94?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd0286227000131a","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Christian
122
+ Sherden","title":"Editor","short_bio":"This is the default bio for a author.
123
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
124
+ is the default bio for a author. It can be edited in the defaults.rb configatron
125
+ file.\n","slug":"christian-sherden","social":{"email":"csherden@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/550984f6a0350bb06435c587a6a7296d?s=48&d=mm","medium":"http://www.gravatar.com/avatar/550984f6a0350bb06435c587a6a7296d?s=128&d=mm","normal":"http://www.gravatar.com/avatar/550984f6a0350bb06435c587a6a7296d?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd02862270001319","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Luke
126
+ Bergen","title":"Editor","short_bio":"This is the default bio for a author.
127
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
128
+ is the default bio for a author. It can be edited in the defaults.rb configatron
129
+ file.\n","slug":"luke-bergen","social":{"email":"lbergen@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/2525364bec7b6147fd21f4796dd7f471?s=48&d=mm","medium":"http://www.gravatar.com/avatar/2525364bec7b6147fd21f4796dd7f471?s=128&d=mm","normal":"http://www.gravatar.com/avatar/2525364bec7b6147fd21f4796dd7f471?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd02862270001318","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Christopher
130
+ Snow","title":"Editor","short_bio":"This is the default bio for a author.
131
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
132
+ is the default bio for a author. It can be edited in the defaults.rb configatron
133
+ file.\n","slug":"christopher-snow","social":{"email":"csnow@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/4e2a6a416de4c975a60c432a6c44491d?s=48&d=mm","medium":"http://www.gravatar.com/avatar/4e2a6a416de4c975a60c432a6c44491d?s=128&d=mm","normal":"http://www.gravatar.com/avatar/4e2a6a416de4c975a60c432a6c44491d?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfbbd02862270001317","created_at":"2012-10-02T15:44:59Z","updated_at":"2012-10-02T15:44:59Z","name":"Keith
134
+ Barry","title":"Editor","short_bio":"This is the default bio for a author.
135
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
136
+ is the default bio for a author. It can be edited in the defaults.rb configatron
137
+ file.\n","slug":"keith-barry","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":{"read":true,"create":true,"update":true,"destroy":true}},{"id":"506b0bfabd02862270001316","created_at":"2012-10-02T15:44:58Z","updated_at":"2012-10-02T15:44:59Z","name":"Chris
138
+ Thomas","title":"Editor","short_bio":"This is the default bio for a author.
139
+ It can be edited in the defaults.rb configatron file.\n","long_bio":"This
140
+ is the default bio for a author. It can be edited in the defaults.rb configatron
141
+ file.\n","slug":"chris-thomas","social":{"email":"cthomas@reviewed.com"},"avatars":{"small":"http://www.gravatar.com/avatar/29e724ec29940a903e976cf3e5536e08?s=48&d=mm","medium":"http://www.gravatar.com/avatar/29e724ec29940a903e976cf3e5536e08?s=128&d=mm","normal":"http://www.gravatar.com/avatar/29e724ec29940a903e976cf3e5536e08?d=mm"},"permissions":{"read":true,"create":true,"update":true,"destroy":true}}]}'
142
+ http_version:
143
+ recorded_at: Tue, 02 Oct 2012 19:07:09 GMT
144
+ recorded_with: VCR 2.2.5
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reviewed::Product do
4
+ describe 'attachments' do
5
+ use_vcr_cassette 'product/attachments'
6
+
7
+ before(:each) do
8
+ @product= Reviewed::Product.find('medium-green-charcoal')
9
+ end
10
+
11
+ it 'returns all attachments' do
12
+ @product.attachments.length.should > 1
13
+ end
14
+
15
+ it 'finds attachments by tag' do
16
+ attachments = @product.attachments('hero')
17
+ attachments.length.should == 1
18
+ attachments.each do |attachment|
19
+ attachment.tags.join(',').should match(/hero/i)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper.rb'
2
+
3
+ describe Reviewed::Request do
4
+ describe 'generic' do
5
+ use_vcr_cassette 'request/authors'
6
+
7
+ before(:each) do
8
+ @response = Reviewed::Request.get('authors')
9
+ end
10
+
11
+ it 'returns a valid response' do
12
+ @response.json[:pagination]["total"].should eql(171)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper.rb'
2
+
3
+ describe Reviewed::Response do
4
+
5
+ describe "response" do
6
+ use_vcr_cassette 'response/authors'
7
+
8
+ before(:each) do
9
+ @response = Reviewed::Request.get('authors')
10
+ end
11
+
12
+ describe "json" do
13
+
14
+ it 'returns json' do
15
+ @response.json[:pagination]["total"].should eql(171)
16
+ end
17
+ end
18
+
19
+ describe "raw" do
20
+
21
+ it 'returns the raw_response' do
22
+ @response.raw.should be_an_instance_of(String)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,25 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+
4
+ require 'reviewed'
5
+ require 'vcr'
6
+
7
+ Dir['spec/support/*'].each { |f| require f }
8
+
9
+ RSpec.configure do |config|
10
+ config.filter_run :focused => true
11
+ config.alias_example_to :fit, :focused => true
12
+ config.alias_example_to :pit, :pending => true
13
+ config.run_all_when_everything_filtered = true
14
+
15
+ config.extend VCR::RSpec::Macros
16
+ end
17
+
18
+ VCR.configure do |config|
19
+ config.default_cassette_options = { record: :new_episodes }
20
+ config.cassette_library_dir = 'spec/fixtures/vcr'
21
+ config.hook_into :webmock
22
+ end
23
+
24
+ TEST_URL = Reviewed.base_uri = 'https://the-guide-staging.herokuapp.com/api'
25
+ TEST_KEY = Reviewed.api_key = '1234567890'
File without changes
data/spec/util_spec.rb ADDED
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reviewed::Util do
4
+ describe 'build request headers' do
5
+ before(:each) do
6
+ @headers = Reviewed::Util.build_request_headers(extra: 1)
7
+ end
8
+
9
+ it 'sets the authorization header' do
10
+ @headers['X-Reviewed-Authorization'].should == Reviewed.api_key
11
+ end
12
+
13
+ it 'sets the accept header' do
14
+ @headers['accept'].should == 'json'
15
+ end
16
+
17
+ it 'sets additional headers' do
18
+ @headers['extra'].should == 1
19
+ end
20
+ end
21
+
22
+ describe 'build query string' do
23
+ it 'includes a single key/value pair' do
24
+ str = Reviewed::Util.build_query_string(name: 'test')
25
+ str.should == 'name=test'
26
+ end
27
+
28
+ it 'includes multiple key/value pairs' do
29
+ str = Reviewed::Util.build_query_string(name: 'test', page: 1)
30
+ str.should == 'name=test&page=1'
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,4 @@
1
+ require 'spec_helper'
2
+
3
+ describe Reviewed::Website do
4
+ end