gecko-ruby 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.rubocop.yml +9 -0
  4. data/.travis.yml +5 -0
  5. data/CHANGELOG.md +41 -0
  6. data/CONTRIBUTING.md +0 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +144 -0
  10. data/Rakefile +19 -0
  11. data/gecko-ruby.gemspec +34 -0
  12. data/generate.thor +81 -0
  13. data/lib/gecko-ruby.rb +1 -0
  14. data/lib/gecko.rb +31 -0
  15. data/lib/gecko/client.rb +132 -0
  16. data/lib/gecko/helpers/association_helper.rb +69 -0
  17. data/lib/gecko/helpers/inspection_helper.rb +51 -0
  18. data/lib/gecko/helpers/record_helper.rb +29 -0
  19. data/lib/gecko/helpers/serialization_helper.rb +61 -0
  20. data/lib/gecko/helpers/validation_helper.rb +91 -0
  21. data/lib/gecko/record/account.rb +66 -0
  22. data/lib/gecko/record/address.rb +33 -0
  23. data/lib/gecko/record/base.rb +66 -0
  24. data/lib/gecko/record/base_adapter.rb +365 -0
  25. data/lib/gecko/record/company.rb +41 -0
  26. data/lib/gecko/record/contact.rb +25 -0
  27. data/lib/gecko/record/currency.rb +23 -0
  28. data/lib/gecko/record/exceptions.rb +15 -0
  29. data/lib/gecko/record/fulfillment.rb +42 -0
  30. data/lib/gecko/record/fulfillment_line_item.rb +26 -0
  31. data/lib/gecko/record/image.rb +38 -0
  32. data/lib/gecko/record/invoice.rb +29 -0
  33. data/lib/gecko/record/invoice_line_item.rb +18 -0
  34. data/lib/gecko/record/location.rb +23 -0
  35. data/lib/gecko/record/order.rb +50 -0
  36. data/lib/gecko/record/order_line_item.rb +35 -0
  37. data/lib/gecko/record/product.rb +27 -0
  38. data/lib/gecko/record/purchase_order.rb +43 -0
  39. data/lib/gecko/record/purchase_order_line_item.rb +29 -0
  40. data/lib/gecko/record/tax_type.rb +21 -0
  41. data/lib/gecko/record/user.rb +44 -0
  42. data/lib/gecko/record/variant.rb +96 -0
  43. data/lib/gecko/version.rb +3 -0
  44. data/test/client_test.rb +29 -0
  45. data/test/fixtures/vcr_cassettes/accounts.yml +57 -0
  46. data/test/fixtures/vcr_cassettes/accounts_current.yml +57 -0
  47. data/test/fixtures/vcr_cassettes/addresses.yml +68 -0
  48. data/test/fixtures/vcr_cassettes/addresses_count.yml +58 -0
  49. data/test/fixtures/vcr_cassettes/companies.yml +62 -0
  50. data/test/fixtures/vcr_cassettes/companies_count.yml +58 -0
  51. data/test/fixtures/vcr_cassettes/contacts.yml +60 -0
  52. data/test/fixtures/vcr_cassettes/contacts_count.yml +58 -0
  53. data/test/fixtures/vcr_cassettes/currencies.yml +62 -0
  54. data/test/fixtures/vcr_cassettes/currencies_count.yml +58 -0
  55. data/test/fixtures/vcr_cassettes/fulfillments.yml +59 -0
  56. data/test/fixtures/vcr_cassettes/fulfillments_count.yml +58 -0
  57. data/test/fixtures/vcr_cassettes/images.yml +59 -0
  58. data/test/fixtures/vcr_cassettes/images_count.yml +58 -0
  59. data/test/fixtures/vcr_cassettes/invoice_line_items.yml +63 -0
  60. data/test/fixtures/vcr_cassettes/invoice_line_items_count.yml +62 -0
  61. data/test/fixtures/vcr_cassettes/invoices.yml +63 -0
  62. data/test/fixtures/vcr_cassettes/invoices_count.yml +62 -0
  63. data/test/fixtures/vcr_cassettes/locations.yml +65 -0
  64. data/test/fixtures/vcr_cassettes/locations_count.yml +58 -0
  65. data/test/fixtures/vcr_cassettes/order_line_items.yml +63 -0
  66. data/test/fixtures/vcr_cassettes/order_line_items_count.yml +62 -0
  67. data/test/fixtures/vcr_cassettes/orders.yml +62 -0
  68. data/test/fixtures/vcr_cassettes/orders_count.yml +58 -0
  69. data/test/fixtures/vcr_cassettes/products.yml +79 -0
  70. data/test/fixtures/vcr_cassettes/products_count.yml +58 -0
  71. data/test/fixtures/vcr_cassettes/products_new_invalid.yml +54 -0
  72. data/test/fixtures/vcr_cassettes/products_new_valid.yml +58 -0
  73. data/test/fixtures/vcr_cassettes/purchase_order_line_items.yml +64 -0
  74. data/test/fixtures/vcr_cassettes/purchase_order_line_items_count.yml +62 -0
  75. data/test/fixtures/vcr_cassettes/purchase_orders.yml +63 -0
  76. data/test/fixtures/vcr_cassettes/purchase_orders_count.yml +62 -0
  77. data/test/fixtures/vcr_cassettes/tax_types.yml +74 -0
  78. data/test/fixtures/vcr_cassettes/tax_types_count.yml +62 -0
  79. data/test/fixtures/vcr_cassettes/users.yml +60 -0
  80. data/test/fixtures/vcr_cassettes/users_count.yml +58 -0
  81. data/test/fixtures/vcr_cassettes/users_current.yml +54 -0
  82. data/test/fixtures/vcr_cassettes/variants.yml +60 -0
  83. data/test/fixtures/vcr_cassettes/variants_count.yml +58 -0
  84. data/test/gecko_test.rb +7 -0
  85. data/test/helpers/association_helper_test.rb +56 -0
  86. data/test/helpers/inspection_helper_test.rb +27 -0
  87. data/test/helpers/serialization_helper_test.rb +30 -0
  88. data/test/helpers/validation_helper_test.rb +24 -0
  89. data/test/record/account_adapter_test.rb +43 -0
  90. data/test/record/address_adapter_test.rb +14 -0
  91. data/test/record/address_test.rb +18 -0
  92. data/test/record/company_adapter_test.rb +14 -0
  93. data/test/record/company_test.rb +18 -0
  94. data/test/record/contact_adapter_test.rb +14 -0
  95. data/test/record/contact_test.rb +18 -0
  96. data/test/record/currency_adapter_test.rb +14 -0
  97. data/test/record/currency_test.rb +18 -0
  98. data/test/record/fulfillment_adapter_test.rb +24 -0
  99. data/test/record/fulfillment_line_item_adapter_test.rb +21 -0
  100. data/test/record/fulfillment_line_item_test.rb +18 -0
  101. data/test/record/fulfillment_test.rb +27 -0
  102. data/test/record/image_adapter_test.rb +14 -0
  103. data/test/record/image_test.rb +25 -0
  104. data/test/record/invoice_adapter_test.rb +14 -0
  105. data/test/record/invoice_line_item_adapter_test.rb +20 -0
  106. data/test/record/invoice_line_item_test.rb +18 -0
  107. data/test/record/invoice_test.rb +18 -0
  108. data/test/record/location_adapter_test.rb +14 -0
  109. data/test/record/location_test.rb +18 -0
  110. data/test/record/order_adapter_test.rb +14 -0
  111. data/test/record/order_line_item_adapter_test.rb +14 -0
  112. data/test/record/order_line_item_test.rb +18 -0
  113. data/test/record/order_test.rb +18 -0
  114. data/test/record/product_adapter_test.rb +32 -0
  115. data/test/record/product_test.rb +18 -0
  116. data/test/record/purchase_order_adapter_test.rb +14 -0
  117. data/test/record/purchase_order_line_item_adapter_test.rb +14 -0
  118. data/test/record/purchase_order_line_item_test.rb +18 -0
  119. data/test/record/purchase_order_test.rb +18 -0
  120. data/test/record/tax_type_adapter_test.rb +14 -0
  121. data/test/record/tax_type_test.rb +18 -0
  122. data/test/record/user_adapter_test.rb +27 -0
  123. data/test/record/user_test.rb +18 -0
  124. data/test/record/variant_adapter_test.rb +14 -0
  125. data/test/record/variant_test.rb +44 -0
  126. data/test/support/let.rb +10 -0
  127. data/test/support/shared_adapter_examples.rb +159 -0
  128. data/test/support/shared_record_examples.rb +21 -0
  129. data/test/support/testing_adapter.rb +11 -0
  130. data/test/support/vcr_support.rb +7 -0
  131. data/test/test_helper.rb +21 -0
  132. metadata +430 -0
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/orders?limit=5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Authorization:
13
+ - Bearer 73f8655eda623d3a7bc99a8d3ff35d47220047041b28e8b83cb49f59a9119f14
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Mon, 03 Mar 2014 01:41:31 GMT
25
+ Status:
26
+ - 200 OK
27
+ Connection:
28
+ - close
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Ua-Compatible:
36
+ - chrome=1
37
+ X-Pagination:
38
+ - '{"total_records":658,"total_pages":132,"first_page":true,"last_page":false,"out_of_bounds":false,"offset":0}'
39
+ Link:
40
+ - <http://api.lvh.me:3000/ajax/orders.json?limit=5&page=2>; rel="next", <http://api.lvh.me:3000/ajax/orders.json?limit=5&page=132>;
41
+ rel="last"
42
+ Content-Type:
43
+ - application/json; charset=utf-8
44
+ Etag:
45
+ - '"cb93a404093feaa63b2ec8dfa04a6c1f"'
46
+ Cache-Control:
47
+ - max-age=0, private, must-revalidate
48
+ X-Request-Id:
49
+ - 6ced971b-751c-455e-bd01-846abd1943f3
50
+ X-Runtime:
51
+ - '0.301508'
52
+ Transfer-Encoding:
53
+ - chunked
54
+ body:
55
+ encoding: UTF-8
56
+ string: '{"orders":[{"id":5706,"fulfillment_ids":[5086,17053],"invoice_ids":[4347],"company_id":106,"shipping_address_id":1171,"billing_address_id":104,"user_id":829,"assignee_id":null,"stock_location_id":159,"currency_id":4,"order_number":"SO0211","phone_number":"98
57
+ 6453651","email":"hello@bikesmoore.com","notes":null,"reference_number":"","status":"fulfilled","payment_status":"unpaid","invoice_status":"partial","invoice_numbers":{"4347":"INV0042"},"packed_status":"packed","fulfillment_status":"shipped","tax_type":"exclusive","default_price_type_id":"wholesale","issued_at":"2013-03-28","created_at":"2013-03-28T08:02:43.377Z","updated_at":"2013-11-14T04:02:23.404Z","ship_at":"2013-04-11","tax_override":null,"tax_label":"GST","tracking_number":null,"source_id":null,"source_url":null,"total":"166.75","source":null,"url":null,"cached_total":"166.75","order_line_item_ids":[12434,12435,12433]},{"id":120661,"fulfillment_ids":[],"invoice_ids":[],"company_id":206086,"shipping_address_id":289097,"billing_address_id":289097,"user_id":1748,"assignee_id":1748,"stock_location_id":3723,"currency_id":4,"order_number":"WC-264","phone_number":null,"email":"email@mail.com","notes":null,"reference_number":null,"status":"deleted","payment_status":"unpaid","invoice_status":"uninvoiced","invoice_numbers":{},"packed_status":"unpacked","fulfillment_status":"unshipped","tax_type":"exclusive","default_price_type_id":"wholesale","issued_at":"2014-01-24","created_at":"2014-01-26T04:17:25.203Z","updated_at":"2014-01-26T04:23:46.599Z","ship_at":"2014-01-24","tax_override":null,"tax_label":"GST","tracking_number":null,"source_id":9,"source_url":null,"total":"220.0","source":"mobile","url":null,"cached_total":"220.0","order_line_item_ids":[445919]},{"id":120668,"fulfillment_ids":[],"invoice_ids":[],"company_id":106,"shipping_address_id":1171,"billing_address_id":104,"user_id":1748,"assignee_id":1748,"stock_location_id":153,"currency_id":4,"order_number":"SOV-5442","phone_number":null,"email":"Test@qwe.qwe","notes":null,"reference_number":"Ref
58
+ 1","status":"draft","payment_status":"unpaid","invoice_status":"uninvoiced","invoice_numbers":{},"packed_status":"unpacked","fulfillment_status":"unshipped","tax_type":"exclusive","default_price_type_id":"wholesale","issued_at":"2014-01-26","created_at":"2014-01-26T05:25:11.085Z","updated_at":"2014-01-29T02:03:16.151Z","ship_at":"2014-02-16","tax_override":null,"tax_label":"GST","tracking_number":null,"source_id":9,"source_url":null,"total":"2.2","source":"mobile","url":null,"cached_total":"2.2","order_line_item_ids":[445950]},{"id":79066,"fulfillment_ids":[],"invoice_ids":[],"company_id":128717,"shipping_address_id":166479,"billing_address_id":166479,"user_id":3809,"assignee_id":3809,"stock_location_id":160,"currency_id":4,"order_number":"SOV-5354","phone_number":null,"email":"asudtelgte@comcast.net","notes":null,"reference_number":null,"status":"finalized","payment_status":"unpaid","invoice_status":"uninvoiced","invoice_numbers":{},"packed_status":"unpacked","fulfillment_status":"unshipped","tax_type":"inclusive","default_price_type_id":"retail","issued_at":"2013-12-02","created_at":"2013-12-02T02:58:45.012Z","updated_at":"2014-01-20T04:18:35.902Z","ship_at":"2013-12-16","tax_override":null,"tax_label":"GST","tracking_number":null,"source_id":null,"source_url":null,"total":0,"source":null,"url":null,"cached_total":0,"order_line_item_ids":[]},{"id":79234,"fulfillment_ids":[56530],"invoice_ids":[],"company_id":215564,"shipping_address_id":298463,"billing_address_id":298464,"user_id":4130,"assignee_id":4130,"stock_location_id":160,"currency_id":4,"order_number":"SOV-5355","phone_number":"0272
59
+ 639 339","email":"adele.garry@xtra.co.nz","notes":null,"reference_number":null,"status":"finalized","payment_status":"unpaid","invoice_status":"uninvoiced","invoice_numbers":{},"packed_status":"packed","fulfillment_status":"unshipped","tax_type":"inclusive","default_price_type_id":"retail","issued_at":"2013-12-02","created_at":"2013-12-02T04:48:22.544Z","updated_at":"2014-01-20T04:18:35.915Z","ship_at":"2013-12-16","tax_override":null,"tax_label":"GST","tracking_number":null,"source_id":null,"source_url":null,"total":"3640.0","source":null,"url":null,"cached_total":"3640.0","order_line_item_ids":[291826]}],"meta":{"total":658}}'
60
+ http_version:
61
+ recorded_at: Mon, 03 Mar 2014 01:41:31 GMT
62
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/orders?limit=0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.2 OAuth2/0.9.3 Ruby/2.0.0
12
+ Authorization:
13
+ - Bearer ca89bd74c095b9d27b62c0e4dff6960123d6df6919d078e96b85081a132014ba
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Sat, 08 Mar 2014 04:18:46 GMT
25
+ Status:
26
+ - 200 OK
27
+ Connection:
28
+ - close
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Ua-Compatible:
36
+ - chrome=1
37
+ X-Pagination:
38
+ - '{"total_records":659,"total_pages":1,"first_page":true,"last_page":true,"out_of_bounds":false,"offset":0}'
39
+ Link:
40
+ - <http://api.lvh.me:3000/ajax/orders.json?limit=0&page=1>; rel="last"
41
+ Content-Type:
42
+ - application/json; charset=utf-8
43
+ Etag:
44
+ - '"7d2c99a7fd668164d619ead0e7d32ac7"'
45
+ Cache-Control:
46
+ - max-age=0, private, must-revalidate
47
+ X-Request-Id:
48
+ - 762f277c-5e2e-4cff-b28f-e9c767fc84c0
49
+ X-Runtime:
50
+ - '0.236228'
51
+ Transfer-Encoding:
52
+ - chunked
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"orders":[],"meta":{"total":659}}'
56
+ http_version:
57
+ recorded_at: Sat, 08 Mar 2014 04:18:46 GMT
58
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,79 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/products?limit=5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Authorization:
13
+ - Bearer a2937ab8d1c824af7866976027340165666eda983c2feba457c1fd32a3efdb50
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 04 Mar 2014 19:58:54 GMT
25
+ Status:
26
+ - 200 OK
27
+ Connection:
28
+ - close
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Ua-Compatible:
36
+ - chrome=1
37
+ X-Pagination:
38
+ - '{"total_records":247,"total_pages":50,"first_page":true,"last_page":false,"out_of_bounds":false,"offset":0}'
39
+ Link:
40
+ - <http://api.lvh.me:3000/ajax/products.json?limit=5&page=2>; rel="next", <http://api.lvh.me:3000/ajax/products.json?limit=5&page=50>;
41
+ rel="last"
42
+ Content-Type:
43
+ - application/json; charset=utf-8
44
+ Etag:
45
+ - '"796e7dc6b4e0b1199c411aa55107e373"'
46
+ Cache-Control:
47
+ - max-age=0, private, must-revalidate
48
+ X-Request-Id:
49
+ - 0b1d9c42-a958-41eb-8d04-c9b9edddb4fa
50
+ X-Runtime:
51
+ - '1.043174'
52
+ Transfer-Encoding:
53
+ - chunked
54
+ body:
55
+ encoding: UTF-8
56
+ string: '{"products":[{"id":498917,"name":"2 Seater Sofa - Florence Knoll Replica","description":null,"product_type":"2
57
+ Seat Sofa","supplier":"Florence Knoll","created_at":"2014-02-05T05:22:43.502Z","updated_at":"2014-02-13T06:41:32.357Z","status":"active","tags":"Office,2
58
+ Seat,Sofa","opt1":"Colour","opt2":" Size ","opt3":null,"quantity":"1","search_cache":"875220-B
59
+ 875220-W White 875220-N Navy","image_url":"https://tradegecko-development-images.s3.amazonaws.com/uploads/variant_image/image/375737/thumbnail_H75WfVALRlGoT0kw97GU_Screen_20Shot_202013-12-05_20at_205.31.34_20pm.png","variant_ids":[936265,936266,936267],"vendor":"Florence
60
+ Knoll"},{"id":525598,"name":"2342423","description":"\u003Cb\u003EWYSIWYG
61
+ test yo!\u003Cbr\u003E\u003Cbr\u003E\u003C/b\u003Essdasds","product_type":"Bag","supplier":"Acme
62
+ Ltd","created_at":"2014-02-14T06:57:48.257Z","updated_at":"2014-02-14T06:57:48.257Z","status":"active","tags":"T-shirts,Winter
63
+ 2012","opt1":"Size","opt2":null,"opt3":null,"quantity":"8","search_cache":"smth
64
+ Default","image_url":null,"variant_ids":[982793],"vendor":"Acme Ltd"},{"id":335784,"name":"2342423","description":"\u003Cb\u003EWYSIWYG
65
+ test yo!\u003Cbr\u003E\u003Cbr\u003E\u003C/b\u003Essdasds","product_type":"Bag","supplier":"Acme
66
+ Ltd","created_at":"2013-11-26T04:22:46.542Z","updated_at":"2014-01-23T09:35:02.493Z","status":"active","tags":"T-shirts,Winter
67
+ 2012","opt1":"Size","opt2":null,"opt3":null,"quantity":"-2","search_cache":"Candy
68
+ Cloud smth Default","image_url":"https://tradegecko-development-images.s3.amazonaws.com/uploads/variant_image/image/289321/thumbnail_yRvqD4lCTH6mZOxhcnX4_Desktop.png","variant_ids":[637964,866954],"vendor":"Acme
69
+ Ltd"},{"id":525599,"name":"666/Brewaucracy Devil in the Details","description":null,"product_type":"Beer","supplier":"666
70
+ Brewing","created_at":"2014-02-14T06:57:48.472Z","updated_at":"2014-02-14T06:57:48.472Z","status":"active","tags":"serial
71
+ number","opt1":"Volume","opt2":null,"opt3":null,"quantity":"0","search_cache":"PWxxx
72
+ Default XXXTEST","image_url":null,"variant_ids":[982794,982968],"vendor":"666
73
+ Brewing"},{"id":411698,"name":"666/Brewaucracy Devil in the Details","description":null,"product_type":"Beer","supplier":"666
74
+ Brewing","created_at":"2014-01-03T03:52:08.220Z","updated_at":"2014-02-05T03:08:26.040Z","status":"active","tags":"serial
75
+ number","opt1":"Volume","opt2":null,"opt3":null,"quantity":"0","search_cache":"PWxxx
76
+ Default","image_url":null,"variant_ids":[879305],"vendor":"666 Brewing"}],"meta":{"total":247}}'
77
+ http_version:
78
+ recorded_at: Tue, 04 Mar 2014 19:58:54 GMT
79
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/products?limit=0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.2 OAuth2/0.9.3 Ruby/2.0.0
12
+ Authorization:
13
+ - Bearer ca89bd74c095b9d27b62c0e4dff6960123d6df6919d078e96b85081a132014ba
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - '*/*'
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Sat, 08 Mar 2014 04:18:46 GMT
25
+ Status:
26
+ - 200 OK
27
+ Connection:
28
+ - close
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Ua-Compatible:
36
+ - chrome=1
37
+ X-Pagination:
38
+ - '{"total_records":247,"total_pages":1,"first_page":true,"last_page":true,"out_of_bounds":false,"offset":0}'
39
+ Link:
40
+ - <http://api.lvh.me:3000/ajax/products.json?limit=0&page=1>; rel="last"
41
+ Content-Type:
42
+ - application/json; charset=utf-8
43
+ Etag:
44
+ - '"f9869eb24c934b9e009236ded4425723"'
45
+ Cache-Control:
46
+ - max-age=0, private, must-revalidate
47
+ X-Request-Id:
48
+ - 5ae631d7-f27a-4ec2-9af6-f3b72720380e
49
+ X-Runtime:
50
+ - '0.202638'
51
+ Transfer-Encoding:
52
+ - chunked
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"products":[],"meta":{"total":247}}'
56
+ http_version:
57
+ recorded_at: Sat, 08 Mar 2014 04:18:46 GMT
58
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.lvh.me:3000/products
6
+ body:
7
+ encoding: UTF-8
8
+ string: product%5Bdescription%5D=&product%5Bname%5D=&product%5Bopt1%5D=&product%5Bopt2%5D=&product%5Bopt3%5D=&product%5Bproduct_type%5D=Gecko&product%5Bstatus%5D=&product%5Bsupplier%5D=&product%5Btags%5D=
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.2 OAuth2/0.9.3 Ruby/2.0.0
12
+ Authorization:
13
+ - Bearer 72b7a0c28664b0984f732359e0a10a5f07a723339bc725d46027a0afc06342e6
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
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: 422
23
+ message: Unprocessable Entity
24
+ headers:
25
+ Date:
26
+ - Mon, 10 Mar 2014 05:17:10 GMT
27
+ Status:
28
+ - 422 Unprocessable Entity
29
+ Connection:
30
+ - close
31
+ X-Frame-Options:
32
+ - SAMEORIGIN
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Ua-Compatible:
38
+ - chrome=1
39
+ Content-Type:
40
+ - application/json; charset=utf-8
41
+ Cache-Control:
42
+ - no-cache
43
+ X-Request-Id:
44
+ - 574f1a21-c102-4acf-82d5-bb47c0546115
45
+ X-Runtime:
46
+ - '0.337702'
47
+ Transfer-Encoding:
48
+ - chunked
49
+ body:
50
+ encoding: UTF-8
51
+ string: '{"errors":{"name":["can''t be blank"]}}'
52
+ http_version:
53
+ recorded_at: Mon, 10 Mar 2014 05:17:10 GMT
54
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,58 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.lvh.me:3000/products
6
+ body:
7
+ encoding: UTF-8
8
+ string: product%5Bdescription%5D=&product%5Bname%5D=Gary&product%5Bopt1%5D=&product%5Bopt2%5D=&product%5Bopt3%5D=&product%5Bproduct_type%5D=&product%5Bstatus%5D=&product%5Bsupplier%5D=&product%5Btags%5D=
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.2 OAuth2/0.9.3 Ruby/2.0.0
12
+ Authorization:
13
+ - Bearer 72b7a0c28664b0984f732359e0a10a5f07a723339bc725d46027a0afc06342e6
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
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: 201
23
+ message: Created
24
+ headers:
25
+ Date:
26
+ - Mon, 10 Mar 2014 05:17:10 GMT
27
+ Status:
28
+ - 201 Created
29
+ Connection:
30
+ - close
31
+ X-Frame-Options:
32
+ - SAMEORIGIN
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Content-Type-Options:
36
+ - nosniff
37
+ X-Ua-Compatible:
38
+ - chrome=1
39
+ Location:
40
+ - http://api.lvh.me:3000/ajax/products/532003
41
+ Content-Type:
42
+ - application/json; charset=utf-8
43
+ Etag:
44
+ - '"d4d2628a442a14e032bf79eb436f22cf"'
45
+ Cache-Control:
46
+ - max-age=0, private, must-revalidate
47
+ X-Request-Id:
48
+ - f8d01cdf-74d0-41ea-b3ec-9412769c88f8
49
+ X-Runtime:
50
+ - '0.114409'
51
+ Transfer-Encoding:
52
+ - chunked
53
+ body:
54
+ encoding: UTF-8
55
+ string: '{"product":{"id":532003,"name":"Gary","description":"","product_type":"","supplier":"","created_at":"2014-03-10T05:17:10.009Z","updated_at":"2014-03-10T05:17:10.009Z","status":"","tags":null,"opt1":"","opt2":"","opt3":"","quantity":"0","search_cache":"","image_url":null,"variant_ids":[],"vendor":""}}'
56
+ http_version:
57
+ recorded_at: Mon, 10 Mar 2014 05:17:10 GMT
58
+ recorded_with: VCR 2.8.0
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/purchase_order_line_items?limit=5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.3 OAuth2/1.0.0 Faraday/0.9.0 Ruby/2.0.0
12
+ Authorization:
13
+ - Bearer d7ebf96f5550d6ffc05474c4da3ce9d8e408ca2540ee0bbcb9e2140d47e64963
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 30 Sep 2014 11:38:37 GMT
25
+ Status:
26
+ - 200 OK
27
+ Connection:
28
+ - close
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Rate-Limit-Limit:
36
+ - '300'
37
+ X-Rate-Limit-Remaining:
38
+ - '293'
39
+ X-Rate-Limit-Reset:
40
+ - '1412077200'
41
+ X-Pagination:
42
+ - '{"total_records":1848,"total_pages":370,"first_page":true,"last_page":false,"out_of_bounds":false,"offset":0}'
43
+ Link:
44
+ - <http://api.lvh.me:3000/ajax/purchase_order_line_items?limit=5&page=2>; rel="next",
45
+ <http://api.lvh.me:3000/ajax/purchase_order_line_items?limit=5&page=370>;
46
+ rel="last"
47
+ Content-Type:
48
+ - application/json; charset=utf-8
49
+ Etag:
50
+ - '"80af45f5e7a985f8216d728bc721a06c"'
51
+ Cache-Control:
52
+ - max-age=0, private, must-revalidate
53
+ X-Request-Id:
54
+ - 41198156-cb4f-4753-947f-bef1e5023c48
55
+ X-Runtime:
56
+ - '0.376681'
57
+ Transfer-Encoding:
58
+ - chunked
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"purchase_order_line_items":[{"id":177772,"purchase_order_id":28381,"variant_id":2033689,"procurement_id":null,"tax_type_id":2103,"quantity":"4999.0","position":0,"tax_rate_override":null,"price":"20.0","label":null,"freeform":false,"base_price":null,"extra_cost_value":"0.0","image_url":null,"tax_rate":null},{"id":177771,"purchase_order_id":28381,"variant_id":2033689,"procurement_id":null,"tax_type_id":2103,"quantity":"5000.0","position":0,"tax_rate_override":null,"price":"20.0","label":null,"freeform":false,"base_price":null,"extra_cost_value":"0.0","image_url":null,"tax_rate":null},{"id":177770,"purchase_order_id":28381,"variant_id":2033689,"procurement_id":null,"tax_type_id":2103,"quantity":"1.0","position":0,"tax_rate_override":null,"price":"20.0","label":null,"freeform":false,"base_price":null,"extra_cost_value":"0.0","image_url":null,"tax_rate":null},{"id":177769,"purchase_order_id":28380,"variant_id":2033689,"procurement_id":null,"tax_type_id":2103,"quantity":"1.0","position":0,"tax_rate_override":null,"price":"20.0","label":null,"freeform":false,"base_price":null,"extra_cost_value":"0.0","image_url":null,"tax_rate":null},{"id":177767,"purchase_order_id":28380,"variant_id":2033689,"procurement_id":null,"tax_type_id":2103,"quantity":"5000.0","position":0,"tax_rate_override":null,"price":"20.0","label":null,"freeform":false,"base_price":null,"extra_cost_value":"0.0","image_url":null,"tax_rate":null}]}'
62
+ http_version:
63
+ recorded_at: Tue, 30 Sep 2014 11:38:37 GMT
64
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,62 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.lvh.me:3000/purchase_order_line_items?limit=0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Gecko/0.0.3 OAuth2/1.0.0 Faraday/0.9.0 Ruby/2.0.0
12
+ Authorization:
13
+ - Bearer d7ebf96f5550d6ffc05474c4da3ce9d8e408ca2540ee0bbcb9e2140d47e64963
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Date:
24
+ - Tue, 30 Sep 2014 11:38:37 GMT
25
+ Status:
26
+ - 200 OK
27
+ Connection:
28
+ - close
29
+ X-Frame-Options:
30
+ - SAMEORIGIN
31
+ X-Xss-Protection:
32
+ - 1; mode=block
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ X-Rate-Limit-Limit:
36
+ - '300'
37
+ X-Rate-Limit-Remaining:
38
+ - '292'
39
+ X-Rate-Limit-Reset:
40
+ - '1412077200'
41
+ X-Pagination:
42
+ - '{"total_records":1848,"total_pages":1,"first_page":true,"last_page":true,"out_of_bounds":false,"offset":0}'
43
+ Link:
44
+ - <http://api.lvh.me:3000/ajax/purchase_order_line_items?limit=0&page=1>; rel="last"
45
+ Content-Type:
46
+ - application/json; charset=utf-8
47
+ Etag:
48
+ - '"2c5b679996e7d0df8708181e6cdacd3a"'
49
+ Cache-Control:
50
+ - max-age=0, private, must-revalidate
51
+ X-Request-Id:
52
+ - 5e11d201-e0a0-4dd1-aca8-245337ac691e
53
+ X-Runtime:
54
+ - '0.137388'
55
+ Transfer-Encoding:
56
+ - chunked
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"purchase_order_line_items":[]}'
60
+ http_version:
61
+ recorded_at: Tue, 30 Sep 2014 11:38:37 GMT
62
+ recorded_with: VCR 2.9.2