gecko-ruby 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.rubocop.yml +9 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +41 -0
- data/CONTRIBUTING.md +0 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +144 -0
- data/Rakefile +19 -0
- data/gecko-ruby.gemspec +34 -0
- data/generate.thor +81 -0
- data/lib/gecko-ruby.rb +1 -0
- data/lib/gecko.rb +31 -0
- data/lib/gecko/client.rb +132 -0
- data/lib/gecko/helpers/association_helper.rb +69 -0
- data/lib/gecko/helpers/inspection_helper.rb +51 -0
- data/lib/gecko/helpers/record_helper.rb +29 -0
- data/lib/gecko/helpers/serialization_helper.rb +61 -0
- data/lib/gecko/helpers/validation_helper.rb +91 -0
- data/lib/gecko/record/account.rb +66 -0
- data/lib/gecko/record/address.rb +33 -0
- data/lib/gecko/record/base.rb +66 -0
- data/lib/gecko/record/base_adapter.rb +365 -0
- data/lib/gecko/record/company.rb +41 -0
- data/lib/gecko/record/contact.rb +25 -0
- data/lib/gecko/record/currency.rb +23 -0
- data/lib/gecko/record/exceptions.rb +15 -0
- data/lib/gecko/record/fulfillment.rb +42 -0
- data/lib/gecko/record/fulfillment_line_item.rb +26 -0
- data/lib/gecko/record/image.rb +38 -0
- data/lib/gecko/record/invoice.rb +29 -0
- data/lib/gecko/record/invoice_line_item.rb +18 -0
- data/lib/gecko/record/location.rb +23 -0
- data/lib/gecko/record/order.rb +50 -0
- data/lib/gecko/record/order_line_item.rb +35 -0
- data/lib/gecko/record/product.rb +27 -0
- data/lib/gecko/record/purchase_order.rb +43 -0
- data/lib/gecko/record/purchase_order_line_item.rb +29 -0
- data/lib/gecko/record/tax_type.rb +21 -0
- data/lib/gecko/record/user.rb +44 -0
- data/lib/gecko/record/variant.rb +96 -0
- data/lib/gecko/version.rb +3 -0
- data/test/client_test.rb +29 -0
- data/test/fixtures/vcr_cassettes/accounts.yml +57 -0
- data/test/fixtures/vcr_cassettes/accounts_current.yml +57 -0
- data/test/fixtures/vcr_cassettes/addresses.yml +68 -0
- data/test/fixtures/vcr_cassettes/addresses_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/companies.yml +62 -0
- data/test/fixtures/vcr_cassettes/companies_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/contacts.yml +60 -0
- data/test/fixtures/vcr_cassettes/contacts_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/currencies.yml +62 -0
- data/test/fixtures/vcr_cassettes/currencies_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/fulfillments.yml +59 -0
- data/test/fixtures/vcr_cassettes/fulfillments_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/images.yml +59 -0
- data/test/fixtures/vcr_cassettes/images_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/invoice_line_items.yml +63 -0
- data/test/fixtures/vcr_cassettes/invoice_line_items_count.yml +62 -0
- data/test/fixtures/vcr_cassettes/invoices.yml +63 -0
- data/test/fixtures/vcr_cassettes/invoices_count.yml +62 -0
- data/test/fixtures/vcr_cassettes/locations.yml +65 -0
- data/test/fixtures/vcr_cassettes/locations_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/order_line_items.yml +63 -0
- data/test/fixtures/vcr_cassettes/order_line_items_count.yml +62 -0
- data/test/fixtures/vcr_cassettes/orders.yml +62 -0
- data/test/fixtures/vcr_cassettes/orders_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/products.yml +79 -0
- data/test/fixtures/vcr_cassettes/products_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/products_new_invalid.yml +54 -0
- data/test/fixtures/vcr_cassettes/products_new_valid.yml +58 -0
- data/test/fixtures/vcr_cassettes/purchase_order_line_items.yml +64 -0
- data/test/fixtures/vcr_cassettes/purchase_order_line_items_count.yml +62 -0
- data/test/fixtures/vcr_cassettes/purchase_orders.yml +63 -0
- data/test/fixtures/vcr_cassettes/purchase_orders_count.yml +62 -0
- data/test/fixtures/vcr_cassettes/tax_types.yml +74 -0
- data/test/fixtures/vcr_cassettes/tax_types_count.yml +62 -0
- data/test/fixtures/vcr_cassettes/users.yml +60 -0
- data/test/fixtures/vcr_cassettes/users_count.yml +58 -0
- data/test/fixtures/vcr_cassettes/users_current.yml +54 -0
- data/test/fixtures/vcr_cassettes/variants.yml +60 -0
- data/test/fixtures/vcr_cassettes/variants_count.yml +58 -0
- data/test/gecko_test.rb +7 -0
- data/test/helpers/association_helper_test.rb +56 -0
- data/test/helpers/inspection_helper_test.rb +27 -0
- data/test/helpers/serialization_helper_test.rb +30 -0
- data/test/helpers/validation_helper_test.rb +24 -0
- data/test/record/account_adapter_test.rb +43 -0
- data/test/record/address_adapter_test.rb +14 -0
- data/test/record/address_test.rb +18 -0
- data/test/record/company_adapter_test.rb +14 -0
- data/test/record/company_test.rb +18 -0
- data/test/record/contact_adapter_test.rb +14 -0
- data/test/record/contact_test.rb +18 -0
- data/test/record/currency_adapter_test.rb +14 -0
- data/test/record/currency_test.rb +18 -0
- data/test/record/fulfillment_adapter_test.rb +24 -0
- data/test/record/fulfillment_line_item_adapter_test.rb +21 -0
- data/test/record/fulfillment_line_item_test.rb +18 -0
- data/test/record/fulfillment_test.rb +27 -0
- data/test/record/image_adapter_test.rb +14 -0
- data/test/record/image_test.rb +25 -0
- data/test/record/invoice_adapter_test.rb +14 -0
- data/test/record/invoice_line_item_adapter_test.rb +20 -0
- data/test/record/invoice_line_item_test.rb +18 -0
- data/test/record/invoice_test.rb +18 -0
- data/test/record/location_adapter_test.rb +14 -0
- data/test/record/location_test.rb +18 -0
- data/test/record/order_adapter_test.rb +14 -0
- data/test/record/order_line_item_adapter_test.rb +14 -0
- data/test/record/order_line_item_test.rb +18 -0
- data/test/record/order_test.rb +18 -0
- data/test/record/product_adapter_test.rb +32 -0
- data/test/record/product_test.rb +18 -0
- data/test/record/purchase_order_adapter_test.rb +14 -0
- data/test/record/purchase_order_line_item_adapter_test.rb +14 -0
- data/test/record/purchase_order_line_item_test.rb +18 -0
- data/test/record/purchase_order_test.rb +18 -0
- data/test/record/tax_type_adapter_test.rb +14 -0
- data/test/record/tax_type_test.rb +18 -0
- data/test/record/user_adapter_test.rb +27 -0
- data/test/record/user_test.rb +18 -0
- data/test/record/variant_adapter_test.rb +14 -0
- data/test/record/variant_test.rb +44 -0
- data/test/support/let.rb +10 -0
- data/test/support/shared_adapter_examples.rb +159 -0
- data/test/support/shared_record_examples.rb +21 -0
- data/test/support/testing_adapter.rb +11 -0
- data/test/support/vcr_support.rb +7 -0
- data/test/test_helper.rb +21 -0
- metadata +430 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'gecko/record/base'
|
2
|
+
|
3
|
+
module Gecko
|
4
|
+
module Record
|
5
|
+
class Variant < Base
|
6
|
+
class VariantLocation
|
7
|
+
include Virtus.model
|
8
|
+
attribute :location_id, Integer
|
9
|
+
attribute :committed_stock, BigDecimal
|
10
|
+
attribute :stock_on_hand, BigDecimal
|
11
|
+
attribute :bin_location, String
|
12
|
+
end
|
13
|
+
|
14
|
+
class VariantPrice
|
15
|
+
include Virtus.model
|
16
|
+
attribute :price_list_id, String
|
17
|
+
attribute :value, BigDecimal
|
18
|
+
end
|
19
|
+
|
20
|
+
belongs_to :product
|
21
|
+
has_many :images
|
22
|
+
|
23
|
+
attribute :name, String
|
24
|
+
attribute :description, String
|
25
|
+
|
26
|
+
attribute :sku, String
|
27
|
+
attribute :upc, String
|
28
|
+
attribute :supplier_code, String
|
29
|
+
|
30
|
+
attribute :opt1, String
|
31
|
+
attribute :opt2, String
|
32
|
+
attribute :opt3, String
|
33
|
+
|
34
|
+
attribute :weight, String
|
35
|
+
|
36
|
+
attribute :status, String, readonly: true
|
37
|
+
|
38
|
+
attribute :product_name, String, readonly: true
|
39
|
+
attribute :product_status, String, readonly: true
|
40
|
+
attribute :product_type, String, readonly: true
|
41
|
+
|
42
|
+
attribute :wholesale_price, BigDecimal
|
43
|
+
attribute :retail_price, BigDecimal
|
44
|
+
attribute :buy_price, BigDecimal
|
45
|
+
|
46
|
+
attribute :moving_average_cost, BigDecimal, readonly: true
|
47
|
+
attribute :last_cost_price, BigDecimal, readonly: true
|
48
|
+
|
49
|
+
attribute :manage_stock, Integer
|
50
|
+
attribute :reorder_point, Integer
|
51
|
+
attribute :max_online, Integer
|
52
|
+
|
53
|
+
attribute :composite, Boolean
|
54
|
+
attribute :keep_selling, Boolean
|
55
|
+
attribute :taxable, Boolean
|
56
|
+
attribute :sellable, Boolean
|
57
|
+
attribute :online_ordering, Boolean
|
58
|
+
|
59
|
+
attribute :position, Integer
|
60
|
+
|
61
|
+
attribute :stock_on_hand, BigDecimal, readonly: true
|
62
|
+
attribute :committed_stock, BigDecimal, readonly: true
|
63
|
+
|
64
|
+
attribute :locations, Array[VariantLocation]
|
65
|
+
attribute :variant_prices, Array[VariantPrice]
|
66
|
+
|
67
|
+
# Returns a display name for a variant
|
68
|
+
#
|
69
|
+
# @example
|
70
|
+
# variant.display_name #=> "ABC12-Alpha Rocket"
|
71
|
+
#
|
72
|
+
# @return [String]
|
73
|
+
#
|
74
|
+
# @api public
|
75
|
+
def display_name
|
76
|
+
if name.nil? || !name.include?(product_name)
|
77
|
+
parts = [sku, product_name, name]
|
78
|
+
else
|
79
|
+
parts = [sku, name]
|
80
|
+
end
|
81
|
+
parts.select { |part| part && part.length }.join(' - ')
|
82
|
+
end
|
83
|
+
|
84
|
+
# attribute :is_online
|
85
|
+
|
86
|
+
## DEPRECATED
|
87
|
+
# attribute :prices, Hash[String => BigDecimal], readonly: true
|
88
|
+
# attribute :stock_levels, Hash[Integer => BigDecimal], readonly: true
|
89
|
+
# attribute :committed_stock_levels, Hash[Integer => BigDecimal], readonly: true
|
90
|
+
# attribute :online_id
|
91
|
+
end
|
92
|
+
|
93
|
+
class VariantAdapter < BaseAdapter
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
data/test/client_test.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ClientTest < Minitest::Test
|
4
|
+
def test_initializes_oauth_client
|
5
|
+
client = Gecko::Client.new("ABC", "DEF")
|
6
|
+
oauth_client = client.oauth_client
|
7
|
+
assert_instance_of OAuth2::Client, oauth_client
|
8
|
+
assert_equal "https://api.tradegecko.com", oauth_client.site
|
9
|
+
assert_equal "ABC", oauth_client.id
|
10
|
+
assert_equal "DEF", oauth_client.secret
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_custom_user_agent
|
14
|
+
client = Gecko::Client.new("ABC", "DEF")
|
15
|
+
agent = client.oauth_client.connection.headers["User-Agent"]
|
16
|
+
assert_match(%r|Gecko/#{Gecko::VERSION} OAuth2/\d.\d.\d Faraday/\d.\d.\d Ruby/\d.\d.\d|, agent)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_allows_test_URLs
|
20
|
+
client = Gecko::Client.new("ABC", "DEF", site: "localhost:3000")
|
21
|
+
assert_equal "localhost:3000", client.oauth_client.site
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_instantiates_base_adapter
|
25
|
+
client = Gecko::Client.new("ABC", "DEF")
|
26
|
+
assert_instance_of Gecko::Record::FulfillmentAdapter, client.Fulfillment
|
27
|
+
assert_equal client.Fulfillment, client.Fulfillment
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.lvh.me:3000/accounts?limit=5
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Authorization:
|
13
|
+
- Bearer 504285880e534514728b011f01c19e57ae44d012c467fdf9b6506f3d4f3cf143
|
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
|
+
- Wed, 05 Mar 2014 02:37:50 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
|
+
Content-Type:
|
38
|
+
- application/json; charset=utf-8
|
39
|
+
Etag:
|
40
|
+
- '"9ec8bd2316f8d086adddae554e9c8172"'
|
41
|
+
Cache-Control:
|
42
|
+
- max-age=0, private, must-revalidate
|
43
|
+
X-Request-Id:
|
44
|
+
- a466ee1e-9dd0-4616-8715-343f55ff93be
|
45
|
+
X-Runtime:
|
46
|
+
- '0.109738'
|
47
|
+
Transfer-Encoding:
|
48
|
+
- chunked
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"accounts":[{"id":7067,"contact_email":"gecko@tradegecko.com","contact_mobile":null,"contact_phone":"555-555-555","country":"SG","default_tax_rate":7.0,"default_tax_type":"exclusive","industry":"Computers,
|
52
|
+
IT Products \u0026 Services","logo_url":null,"name":"Gecko Inc.","invoice_details":"Your
|
53
|
+
prompt payment is greatly appreciated","order_details":null,"quote_details":null,"website":null,"expires_at":"2014-03-26T02:34:30.000Z","subscription_name":"Small","subscription_price":99.0,"annual_subscription_price":79.0,"tax_number":"","tax_number_label":"GST
|
54
|
+
Number","tax_label":"GST","default_order_price_type_id":"wholesale","default_purchase_order_price_type_id":"buy","time_zone":"Asia/Singapore","stock_level_warn":true,"primary_location_id":8409,"primary_billing_location_id":8409,"default_currency_id":8078,"default_payment_term_id":20562,"billing_contact_id":8926,"location_ids":[8409],"user_ids":[8926]}]}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Wed, 05 Mar 2014 02:37:50 GMT
|
57
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.lvh.me:3000/accounts/current
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Authorization:
|
13
|
+
- Bearer 504285880e534514728b011f01c19e57ae44d012c467fdf9b6506f3d4f3cf143
|
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
|
+
- Wed, 05 Mar 2014 02:38:20 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
|
+
Content-Type:
|
38
|
+
- application/json; charset=utf-8
|
39
|
+
Etag:
|
40
|
+
- '"8e1fff7a61c4aace2ff5d5c52fcf583d"'
|
41
|
+
Cache-Control:
|
42
|
+
- max-age=0, private, must-revalidate
|
43
|
+
X-Request-Id:
|
44
|
+
- 242f8544-60db-4c75-a026-8aebccf7ade4
|
45
|
+
X-Runtime:
|
46
|
+
- '0.222954'
|
47
|
+
Transfer-Encoding:
|
48
|
+
- chunked
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: '{"account":{"id":7067,"contact_email":"gecko@tradegecko.com","contact_mobile":null,"contact_phone":"555-555-555","country":"SG","default_tax_rate":7.0,"default_tax_type":"exclusive","industry":"Computers,
|
52
|
+
IT Products \u0026 Services","logo_url":null,"name":"Gecko Inc.","invoice_details":"Your
|
53
|
+
prompt payment is greatly appreciated","order_details":null,"quote_details":null,"website":null,"expires_at":"2014-03-26T02:34:30.000Z","subscription_name":"Small","subscription_price":99.0,"annual_subscription_price":79.0,"tax_number":"","tax_number_label":"GST
|
54
|
+
Number","tax_label":"GST","default_order_price_type_id":"wholesale","default_purchase_order_price_type_id":"buy","time_zone":"Asia/Singapore","stock_level_warn":true,"primary_location_id":8409,"primary_billing_location_id":8409,"default_currency_id":8078,"default_payment_term_id":20562,"billing_contact_id":8926,"location_ids":[8409],"user_ids":[8926]}}'
|
55
|
+
http_version:
|
56
|
+
recorded_at: Wed, 05 Mar 2014 02:38:20 GMT
|
57
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,68 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.lvh.me:3000/addresses?limit=5
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Authorization:
|
13
|
+
- Bearer 23af81161fe7f54dd6d065210808049612b5bb0cf7a3e487a8e48eb9e230eac2
|
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 03:54:00 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":313,"total_pages":63,"first_page":true,"last_page":false,"out_of_bounds":false,"offset":0}'
|
39
|
+
Link:
|
40
|
+
- <http://api.lvh.me:3000/ajax/addresses.json?limit=5&page=2>; rel="next", <http://api.lvh.me:3000/ajax/addresses.json?limit=5&page=63>;
|
41
|
+
rel="last"
|
42
|
+
Content-Type:
|
43
|
+
- application/json; charset=utf-8
|
44
|
+
Etag:
|
45
|
+
- '"1335282ee1bc06f91a171f34dc53f550"'
|
46
|
+
Cache-Control:
|
47
|
+
- max-age=0, private, must-revalidate
|
48
|
+
X-Request-Id:
|
49
|
+
- 3ca09e33-6647-4c75-8c79-70107f0e747e
|
50
|
+
X-Runtime:
|
51
|
+
- '1.981293'
|
52
|
+
Transfer-Encoding:
|
53
|
+
- chunked
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
string: '{"addresses":[{"id":3,"company_id":3,"city":"Auckland","company_name":"TradeGecko","country":"NZ","label":"Shipping","state":"","address1":"14a
|
57
|
+
York St","address2":null,"suburb":"Parnell","zip_code":"123456","phone_number":null,"email":null,"status":"active"},{"id":42,"company_id":2,"city":"Auckland","company_name":"Saks
|
58
|
+
Fifth Avenue","country":"NZL","label":"Billing","state":"","address1":"7 jhsjhsd
|
59
|
+
jsd","address2":null,"suburb":"hernebay","zip_code":"1022","phone_number":null,"email":null,"status":"active"},{"id":43,"company_id":2,"city":"auckland","company_name":"Saks
|
60
|
+
Fifth Avenue","country":"NZL","label":"Shipping","state":"","address1":"65
|
61
|
+
hgsdhsgd","address2":null,"suburb":"ytdy hnb","zip_code":"7637","phone_number":null,"email":null,"status":"active"},{"id":101,"company_id":103,"city":null,"company_name":"Mike''s
|
62
|
+
Bikes","country":null,"label":"Billing Address","state":null,"address1":"234
|
63
|
+
test st","address2":null,"suburb":null,"zip_code":null,"phone_number":null,"email":null,"status":"active"},{"id":102,"company_id":104,"city":null,"company_name":"Stove
|
64
|
+
Top Cafe","country":null,"label":"Billing Address","state":null,"address1":"54
|
65
|
+
test st","address2":null,"suburb":null,"zip_code":null,"phone_number":null,"email":null,"status":"active"}]}'
|
66
|
+
http_version:
|
67
|
+
recorded_at: Mon, 03 Mar 2014 03:54:00 GMT
|
68
|
+
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/addresses?limit=0
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Gecko/0.0.3 OAuth2/0.9.3 Faraday/0.9.0 Ruby/2.0.0
|
12
|
+
Authorization:
|
13
|
+
- Bearer 7d3ed5d622e3becc591f15132f07bb52f05fcbd899f6d9dce60409c0e2c712e5
|
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
|
+
- Thu, 15 May 2014 09:55: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-Ua-Compatible:
|
36
|
+
- chrome=1
|
37
|
+
X-Pagination:
|
38
|
+
- '{"total_records":315,"total_pages":1,"first_page":true,"last_page":true,"out_of_bounds":false,"offset":0}'
|
39
|
+
Link:
|
40
|
+
- <http://api.lvh.me:3000/ajax/addresses?limit=0&page=1>; rel="last"
|
41
|
+
Content-Type:
|
42
|
+
- application/json; charset=utf-8
|
43
|
+
Etag:
|
44
|
+
- '"0101149a34ad34d876b3c55b3cbc0e5b"'
|
45
|
+
Cache-Control:
|
46
|
+
- max-age=0, private, must-revalidate
|
47
|
+
X-Request-Id:
|
48
|
+
- 1d811553-4652-4b5e-84c2-f97cbf8582ff
|
49
|
+
X-Runtime:
|
50
|
+
- '1.762898'
|
51
|
+
Transfer-Encoding:
|
52
|
+
- chunked
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"addresses":[]}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Thu, 15 May 2014 09:55:37 GMT
|
58
|
+
recorded_with: VCR 2.9.0
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://api.lvh.me:3000/companies?limit=5
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Authorization:
|
13
|
+
- Bearer ca82dd1f31d34b1e9b76a2ce2488b552d130788659ce0cf8c665aaffd9c7387d
|
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 06:40:06 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":157,"total_pages":32,"first_page":true,"last_page":false,"out_of_bounds":false,"offset":0}'
|
39
|
+
Link:
|
40
|
+
- <http://api.lvh.me:3000/ajax/companies.json?limit=5&page=2>; rel="next", <http://api.lvh.me:3000/ajax/companies.json?limit=5&page=32>;
|
41
|
+
rel="last"
|
42
|
+
Content-Type:
|
43
|
+
- application/json; charset=utf-8
|
44
|
+
Etag:
|
45
|
+
- '"199304dd0cab85b5b5243d035fe23825"'
|
46
|
+
Cache-Control:
|
47
|
+
- max-age=0, private, must-revalidate
|
48
|
+
X-Request-Id:
|
49
|
+
- 1de8d3bf-0329-442b-9885-e5e9b3087f4d
|
50
|
+
X-Runtime:
|
51
|
+
- '0.705001'
|
52
|
+
Transfer-Encoding:
|
53
|
+
- chunked
|
54
|
+
body:
|
55
|
+
encoding: UTF-8
|
56
|
+
string: '{"companies":[{"id":114,"assignee_id":null,"name":"Cupcake Boutique","description":null,"phone_number":null,"status":"active","email":"cakes@cupcakeboutique.com","website":null,"company_type":"business","company_code":"8974531","fax":null,"default_tax_rate":null,"default_discount_rate":null,"default_price_type_id":"buy","default_payment_term_id":null,"tax_number":null,"address_ids":[56975],"contact_ids":[13352],"note_ids":[]},{"id":109,"assignee_id":null,"name":"Lagoon
|
57
|
+
Bike and Bits","description":null,"phone_number":null,"status":"active","email":null,"website":null,"company_type":"business","company_code":"243678","fax":null,"default_tax_rate":null,"default_discount_rate":null,"default_price_type_id":null,"default_payment_term_id":null,"tax_number":null,"address_ids":[],"contact_ids":[29537],"note_ids":[]},{"id":110,"assignee_id":null,"name":"Ludwigs","description":null,"phone_number":null,"status":"active","email":null,"website":null,"company_type":"business","company_code":"789065","fax":null,"default_tax_rate":null,"default_discount_rate":null,"default_price_type_id":null,"default_payment_term_id":null,"tax_number":null,"address_ids":[],"contact_ids":[],"note_ids":[]},{"id":111,"assignee_id":null,"name":"Cameo
|
58
|
+
Creamers Cafe","description":null,"phone_number":null,"status":"active","email":"office@cameo.com","website":null,"company_type":"business","company_code":"456789","fax":null,"default_tax_rate":null,"default_discount_rate":null,"default_price_type_id":null,"default_payment_term_id":null,"tax_number":null,"address_ids":[],"contact_ids":[],"note_ids":[]},{"id":65158,"assignee_id":null,"name":"Moonis
|
59
|
+
test ltd","description":null,"phone_number":"123456748","status":"active","email":"info@moonis.com","website":"","company_type":"business","company_code":"testts","fax":"","default_tax_rate":17.0,"default_discount_rate":5.0,"default_price_type_id":"wholesale","default_payment_term_id":null,"tax_number":null,"address_ids":[],"contact_ids":[],"note_ids":[]}],"meta":{"total":157}}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Mon, 03 Mar 2014 06:40:06 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/companies?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:45 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":157,"total_pages":1,"first_page":true,"last_page":true,"out_of_bounds":false,"offset":0}'
|
39
|
+
Link:
|
40
|
+
- <http://api.lvh.me:3000/ajax/companies.json?limit=0&page=1>; rel="last"
|
41
|
+
Content-Type:
|
42
|
+
- application/json; charset=utf-8
|
43
|
+
Etag:
|
44
|
+
- '"f4cb11f70a403d5862a013aea01f77e2"'
|
45
|
+
Cache-Control:
|
46
|
+
- max-age=0, private, must-revalidate
|
47
|
+
X-Request-Id:
|
48
|
+
- 183c027c-4563-4b1f-9028-d296cf94af21
|
49
|
+
X-Runtime:
|
50
|
+
- '0.427450'
|
51
|
+
Transfer-Encoding:
|
52
|
+
- chunked
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"companies":[],"meta":{"total":157}}'
|
56
|
+
http_version:
|
57
|
+
recorded_at: Sat, 08 Mar 2014 04:18:45 GMT
|
58
|
+
recorded_with: VCR 2.8.0
|