shopify-mock 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 (50) hide show
  1. data/.gitignore +4 -0
  2. data/.rspec +2 -0
  3. data/.travis.yml +1 -0
  4. data/Gemfile +4 -0
  5. data/README.rdoc +61 -0
  6. data/Rakefile +1 -0
  7. data/lib/shopify-mock.rb +37 -0
  8. data/lib/shopify-mock/fixtures.rb +41 -0
  9. data/lib/shopify-mock/fixtures/articles.json +30 -0
  10. data/lib/shopify-mock/fixtures/assets.json +136 -0
  11. data/lib/shopify-mock/fixtures/blogs.json +15 -0
  12. data/lib/shopify-mock/fixtures/collect.json +11 -0
  13. data/lib/shopify-mock/fixtures/comments.json +19 -0
  14. data/lib/shopify-mock/fixtures/count.json +3 -0
  15. data/lib/shopify-mock/fixtures/countries.json +16 -0
  16. data/lib/shopify-mock/fixtures/custom_collections.json +14 -0
  17. data/lib/shopify-mock/fixtures/customer_groups.json +25 -0
  18. data/lib/shopify-mock/fixtures/customers.json +32 -0
  19. data/lib/shopify-mock/fixtures/events.json +13 -0
  20. data/lib/shopify-mock/fixtures/fulfillments.json +35 -0
  21. data/lib/shopify-mock/fixtures/images.json +12 -0
  22. data/lib/shopify-mock/fixtures/metafields.json +14 -0
  23. data/lib/shopify-mock/fixtures/orders.json +141 -0
  24. data/lib/shopify-mock/fixtures/pages.json +16 -0
  25. data/lib/shopify-mock/fixtures/product_search_engines.json +8 -0
  26. data/lib/shopify-mock/fixtures/products.json +114 -0
  27. data/lib/shopify-mock/fixtures/provinces.json +100 -0
  28. data/lib/shopify-mock/fixtures/redirects.json +19 -0
  29. data/lib/shopify-mock/fixtures/script_tags.json +11 -0
  30. data/lib/shopify-mock/fixtures/shop.json +26 -0
  31. data/lib/shopify-mock/fixtures/smart_collections.json +21 -0
  32. data/lib/shopify-mock/fixtures/test.json +3 -0
  33. data/lib/shopify-mock/fixtures/themes.json +25 -0
  34. data/lib/shopify-mock/fixtures/transactions.json +13 -0
  35. data/lib/shopify-mock/fixtures/variants.json +84 -0
  36. data/lib/shopify-mock/fixtures/webhooks.json +12 -0
  37. data/lib/shopify-mock/responses.rb +17 -0
  38. data/lib/shopify-mock/responses/articles.rb +5 -0
  39. data/lib/shopify-mock/responses/orders.rb +6 -0
  40. data/lib/shopify-mock/urls.rb +7 -0
  41. data/lib/shopify-mock/version.rb +3 -0
  42. data/shopify-mock.gemspec +28 -0
  43. data/spec/mockify/fixtures_spec.rb +39 -0
  44. data/spec/mockify/responses/articles_spec.rb +25 -0
  45. data/spec/mockify/responses/orders_spec.rb +25 -0
  46. data/spec/spec_helper.rb +9 -0
  47. data/spec/support/fixture_support.rb +5 -0
  48. data/spec/support/http_support.rb +11 -0
  49. data/spec/support/url_support.rb +8 -0
  50. metadata +126 -0
@@ -0,0 +1,32 @@
1
+ {
2
+ "customers": [
3
+ {
4
+ "accepts_marketing": false,
5
+ "orders_count": 0,
6
+ "addresses": [
7
+ {
8
+ "name": null,
9
+ "address1": "Chestnut Street 92",
10
+ "city": "Louisville",
11
+ "company": null,
12
+ "address2": "",
13
+ "zip": "40202",
14
+ "country_code": null,
15
+ "country": "US",
16
+ "province_code": null,
17
+ "last_name": null,
18
+ "phone": "555-625-1199",
19
+ "province": "KY",
20
+ "first_name": null
21
+ }
22
+ ],
23
+ "tags": "",
24
+ "id": 207119551,
25
+ "note": null,
26
+ "last_name": "Norman",
27
+ "total_spent": "0.00",
28
+ "first_name": "Bob",
29
+ "email": "bob.norman@hostmail.com"
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "events": [
3
+ {
4
+ "verb": "confirmed",
5
+ "created_at": "2008-01-10T11:00:00-05:00",
6
+ "body": null,
7
+ "subject_id": 450789469,
8
+ "id": 164748010,
9
+ "subject_type": "Order",
10
+ "message": "Received new order <a href=\"/admin/orders/show/450789469\">#1001</a> by Bob Norman"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "fulfillments": [
3
+ {
4
+ "tracking_company": null,
5
+ "created_at": "2011-09-06T11:46:12-04:00",
6
+ "line_items": [
7
+ {
8
+ "name": "IPod Nano - 8gb - green",
9
+ "price": "199.00",
10
+ "product_id": 632910392,
11
+ "quantity": 1,
12
+ "requires_shipping": true,
13
+ "title": "IPod Nano - 8gb",
14
+ "id": 466157049,
15
+ "grams": 200,
16
+ "sku": "IPOD2008GREEN",
17
+ "fulfillment_status": null,
18
+ "variant_title": "green",
19
+ "vendor": null,
20
+ "fulfillment_service": "manual",
21
+ "variant_id": 39072856
22
+ }
23
+ ],
24
+ "updated_at": "2011-09-06T11:46:12-04:00",
25
+ "order_id": 450789469,
26
+ "id": 255858046,
27
+ "receipt": {
28
+ "testcase": true,
29
+ "authorization": "123456"
30
+ },
31
+ "tracking_number": "1Z2345",
32
+ "status": "failed"
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "images": [
3
+ {
4
+ "position": 2,
5
+ "created_at": "2011-09-06T11:50:11-04:00",
6
+ "product_id": 632910392,
7
+ "updated_at": "2011-09-06T11:50:11-04:00",
8
+ "src": "http://static.shopify.com/s/files/1/6909/3384/products/rails_logo.gif?1",
9
+ "id": 916933528
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "metafields": [
3
+ {
4
+ "created_at": "2011-09-06T11:48:20-04:00",
5
+ "updated_at": "2011-09-06T11:48:20-04:00",
6
+ "namespace": "inventory",
7
+ "id": 909327693,
8
+ "value": "25",
9
+ "description": null,
10
+ "key": "warehouse",
11
+ "value_type": "integer"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "orders": [
3
+ {
4
+ "number": 1,
5
+ "name": "#1001",
6
+ "tax_lines": [
7
+ {
8
+ "price": "11.94",
9
+ "title": "State Tax",
10
+ "rate": 0.06
11
+ }
12
+ ],
13
+ "browser_ip": null,
14
+ "total_discounts": "0.00",
15
+ "created_at": "2008-01-10T11:00:00-05:00",
16
+ "line_items": [
17
+ {
18
+ "name": "IPod Nano - 8gb - green",
19
+ "price": "199.00",
20
+ "product_id": 632910392,
21
+ "quantity": 1,
22
+ "requires_shipping": true,
23
+ "title": "IPod Nano - 8gb",
24
+ "id": 466157049,
25
+ "grams": 200,
26
+ "sku": "IPOD2008GREEN",
27
+ "fulfillment_status": null,
28
+ "variant_title": "green",
29
+ "vendor": null,
30
+ "fulfillment_service": "manual",
31
+ "variant_id": 39072856
32
+ },
33
+ {
34
+ "name": "IPod Nano - 8gb - black",
35
+ "price": "199.00",
36
+ "product_id": 632910392,
37
+ "quantity": 1,
38
+ "requires_shipping": true,
39
+ "title": "IPod Nano - 8gb",
40
+ "id": 703073504,
41
+ "grams": 200,
42
+ "sku": "IPOD2008BLACK",
43
+ "fulfillment_status": null,
44
+ "variant_title": "black",
45
+ "vendor": null,
46
+ "fulfillment_service": "manual",
47
+ "variant_id": 457924702
48
+ }
49
+ ],
50
+ "cancel_reason": null,
51
+ "payment_details": {
52
+ "credit_card_number": "XXXX-XXXX-XXXX-4242",
53
+ "credit_card_company": "Visa"
54
+ },
55
+ "updated_at": "2008-01-10T11:00:00-05:00",
56
+ "total_price": "210.94",
57
+ "token": "b1946ac92492d2347c6235b4d2611184",
58
+ "landing_site_ref": "abc",
59
+ "taxes_included": false,
60
+ "landing_site": "http://www.example.com?source=abc",
61
+ "shipping_lines": [
62
+ {
63
+ "price": "0.00",
64
+ "code": "Free Shipping",
65
+ "title": "Free Shipping"
66
+ }
67
+ ],
68
+ "shipping_address": {
69
+ "name": "Bob Norman",
70
+ "address1": "Chestnut Street 92",
71
+ "city": "Louisville",
72
+ "company": null,
73
+ "address2": "",
74
+ "latitude": "45.41634",
75
+ "zip": "40202",
76
+ "country_code": "US",
77
+ "country": "United States",
78
+ "province_code": "KY",
79
+ "last_name": "Norman",
80
+ "phone": "555-625-1199",
81
+ "longitude": "-75.6868",
82
+ "province": "Kentucky",
83
+ "first_name": "Bob"
84
+ },
85
+ "id": 450789469,
86
+ "cancelled_at": null,
87
+ "order_number": 1001,
88
+ "total_line_items_price": "199.00",
89
+ "referring_site": "http://www.otherexample.com",
90
+ "billing_address": {
91
+ "name": "Bob Norman",
92
+ "address1": "Chestnut Street 92",
93
+ "city": "Louisville",
94
+ "company": null,
95
+ "address2": "",
96
+ "latitude": "45.41634",
97
+ "zip": "40202",
98
+ "country_code": "US",
99
+ "country": "United States",
100
+ "province_code": "KY",
101
+ "last_name": "Norman",
102
+ "phone": "555-625-1199",
103
+ "longitude": "-75.6868",
104
+ "province": "Kentucky",
105
+ "first_name": "Bob"
106
+ },
107
+ "subtotal_price": "199.00",
108
+ "note": null,
109
+ "customer": {
110
+ "accepts_marketing": false,
111
+ "orders_count": 0,
112
+ "id": 207119551,
113
+ "tags": "",
114
+ "last_name": "Norman",
115
+ "note": null,
116
+ "email": "bob.norman@hostmail.com",
117
+ "first_name": "Bob",
118
+ "total_spent": "0.00"
119
+ },
120
+ "note_attributes": [
121
+ {
122
+ "name": "colour",
123
+ "value": "green"
124
+ },
125
+ {
126
+ "name": "custom engraving",
127
+ "value": "Happy Birthday"
128
+ }
129
+ ],
130
+ "gateway": "authorize_net",
131
+ "fulfillment_status": null,
132
+ "financial_status": "authorized",
133
+ "currency": "USD",
134
+ "closed_at": null,
135
+ "buyer_accepts_marketing": false,
136
+ "total_tax": "11.94",
137
+ "total_weight": 0,
138
+ "email": "bob.norman@hostmail.com"
139
+ }
140
+ ]
141
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "pages": [
3
+ {
4
+ "handle": "tos",
5
+ "created_at": "2008-07-15T20:00:00-04:00",
6
+ "body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
7
+ "title": "Terms of Services",
8
+ "template_suffix": null,
9
+ "author": "Dennis",
10
+ "updated_at": "2008-07-16T20:00:00-04:00",
11
+ "shop_id": 690933842,
12
+ "id": 131092082,
13
+ "published_at": "2008-07-15T20:00:00-04:00"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "product_search_engines": [
3
+ {
4
+ "name": "Google Product Search",
5
+ "created_at": "2011-09-06T11:50:04-04:00"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "products": [
3
+ {
4
+ "product_type": "Cult Products",
5
+ "handle": "ipod-nano",
6
+ "created_at": "2011-09-06T11:46:13-04:00",
7
+ "body_html": "<p>It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.</p>",
8
+ "title": "IPod Nano - 8GB",
9
+ "template_suffix": null,
10
+ "updated_at": "2011-09-06T11:46:13-04:00",
11
+ "tags": "Emotive, Flash Memory, MP3, Music",
12
+ "id": 632910392,
13
+ "images": [
14
+ {
15
+ "position": 1,
16
+ "created_at": "2011-09-06T11:46:13-04:00",
17
+ "product_id": 632910392,
18
+ "updated_at": "2011-09-06T11:46:13-04:00",
19
+ "src": "http://static.shopify.com/s/files/1/6909/3384/products/ipod-nano.png?0",
20
+ "id": 850703190
21
+ }
22
+ ],
23
+ "variants": [
24
+ {
25
+ "position": 1,
26
+ "price": "199.00",
27
+ "created_at": "2011-09-06T11:46:13-04:00",
28
+ "requires_shipping": true,
29
+ "title": "Pink",
30
+ "inventory_quantity": 10,
31
+ "compare_at_price": null,
32
+ "inventory_policy": "continue",
33
+ "updated_at": "2011-09-06T11:46:13-04:00",
34
+ "inventory_management": "shopify",
35
+ "id": 808950810,
36
+ "taxable": true,
37
+ "grams": 200,
38
+ "sku": "IPOD2008PINK",
39
+ "option1": "Pink",
40
+ "fulfillment_service": "manual",
41
+ "option2": null,
42
+ "option3": null
43
+ },
44
+ {
45
+ "position": 2,
46
+ "price": "199.00",
47
+ "created_at": "2011-09-06T11:46:13-04:00",
48
+ "requires_shipping": true,
49
+ "title": "Red",
50
+ "inventory_quantity": 20,
51
+ "compare_at_price": null,
52
+ "inventory_policy": "continue",
53
+ "updated_at": "2011-09-06T11:46:13-04:00",
54
+ "inventory_management": "shopify",
55
+ "id": 49148385,
56
+ "taxable": true,
57
+ "grams": 200,
58
+ "sku": "IPOD2008RED",
59
+ "option1": "Red",
60
+ "fulfillment_service": "manual",
61
+ "option2": null,
62
+ "option3": null
63
+ },
64
+ {
65
+ "position": 3,
66
+ "price": "199.00",
67
+ "created_at": "2011-09-06T11:46:13-04:00",
68
+ "requires_shipping": true,
69
+ "title": "Green",
70
+ "inventory_quantity": 30,
71
+ "compare_at_price": null,
72
+ "inventory_policy": "continue",
73
+ "updated_at": "2011-09-06T11:46:13-04:00",
74
+ "inventory_management": "shopify",
75
+ "id": 39072856,
76
+ "taxable": true,
77
+ "grams": 200,
78
+ "sku": "IPOD2008GREEN",
79
+ "option1": "Green",
80
+ "fulfillment_service": "manual",
81
+ "option2": null,
82
+ "option3": null
83
+ },
84
+ {
85
+ "position": 4,
86
+ "price": "199.00",
87
+ "created_at": "2011-09-06T11:46:13-04:00",
88
+ "requires_shipping": true,
89
+ "title": "Black",
90
+ "inventory_quantity": 40,
91
+ "compare_at_price": null,
92
+ "inventory_policy": "continue",
93
+ "updated_at": "2011-09-06T11:46:13-04:00",
94
+ "inventory_management": "shopify",
95
+ "id": 457924702,
96
+ "taxable": true,
97
+ "grams": 200,
98
+ "sku": "IPOD2008BLACK",
99
+ "option1": "Black",
100
+ "fulfillment_service": "manual",
101
+ "option2": null,
102
+ "option3": null
103
+ }
104
+ ],
105
+ "vendor": "Apple",
106
+ "published_at": "2007-12-31T19:00:00-05:00",
107
+ "options": [
108
+ {
109
+ "name": "Title"
110
+ }
111
+ ]
112
+ }
113
+ ]
114
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "provinces": [
3
+ {
4
+ "tax": 0.08,
5
+ "name": "Alberta",
6
+ "tax_name": null,
7
+ "code": "AB",
8
+ "id": 205434194,
9
+ "tax_type": null
10
+ },
11
+ {
12
+ "tax": 0.07,
13
+ "name": "British Columbia",
14
+ "tax_name": null,
15
+ "code": "BC",
16
+ "id": 170405627,
17
+ "tax_type": null
18
+ },
19
+ {
20
+ "tax": 0.07,
21
+ "name": "Manitoba",
22
+ "tax_name": null,
23
+ "code": "MB",
24
+ "id": 342345110,
25
+ "tax_type": null
26
+ },
27
+ {
28
+ "tax": 0.15,
29
+ "name": "New Brunswick",
30
+ "tax_name": null,
31
+ "code": "NB",
32
+ "id": 92264567,
33
+ "tax_type": null
34
+ },
35
+ {
36
+ "tax": 0.15,
37
+ "name": "Newfoundland",
38
+ "tax_name": null,
39
+ "code": "NF",
40
+ "id": 243284171,
41
+ "tax_type": null
42
+ },
43
+ {
44
+ "tax": 0.0,
45
+ "name": "Northwest Territories",
46
+ "tax_name": null,
47
+ "code": "NT",
48
+ "id": 439598329,
49
+ "tax_type": null
50
+ },
51
+ {
52
+ "tax": 0.15,
53
+ "name": "Nova Scotia",
54
+ "tax_name": null,
55
+ "code": "NS",
56
+ "id": 448070559,
57
+ "tax_type": null
58
+ },
59
+ {
60
+ "tax": 0.0,
61
+ "name": "Nunavut",
62
+ "tax_name": null,
63
+ "code": "NU",
64
+ "id": 670206421,
65
+ "tax_type": null
66
+ },
67
+ {
68
+ "tax": 0.08,
69
+ "name": "Ontario",
70
+ "tax_name": null,
71
+ "code": "ON",
72
+ "id": 702530425,
73
+ "tax_type": null
74
+ },
75
+ {
76
+ "tax": 0.1,
77
+ "name": "Prince Edward Island",
78
+ "tax_name": null,
79
+ "code": "PE",
80
+ "id": 570891722,
81
+ "tax_type": null
82
+ },
83
+ {
84
+ "tax": 0.09,
85
+ "name": "Quebec",
86
+ "tax_name": null,
87
+ "code": "QC",
88
+ "id": 224293623,
89
+ "tax_type": null
90
+ },
91
+ {
92
+ "tax": 0.0,
93
+ "name": "Yukon",
94
+ "tax_name": null,
95
+ "code": "YT",
96
+ "id": 1005264686,
97
+ "tax_type": null
98
+ }
99
+ ]
100
+ }