shopify_api 3.1.8 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.travis.yml +32 -0
- data/CHANGELOG +14 -2
- data/Gemfile.lock +2 -2
- data/Gemfile_ar30 +9 -0
- data/Gemfile_ar31 +9 -0
- data/Gemfile_ar32 +9 -0
- data/README.rdoc +18 -15
- data/lib/active_resource/base_ext.rb +14 -15
- data/lib/active_resource/disable_prefix_check.rb +14 -0
- data/lib/active_resource/json_errors.rb +14 -4
- data/lib/active_resource/to_query.rb +10 -0
- data/lib/shopify_api.rb +1 -0
- data/lib/shopify_api/resources.rb +1 -1
- data/lib/shopify_api/resources/base.rb +4 -0
- data/lib/shopify_api/resources/customer.rb +4 -1
- data/lib/shopify_api/resources/fulfillment_service.rb +4 -0
- data/lib/shopify_api/resources/order_risk.rb +8 -0
- data/lib/shopify_api/session.rb +18 -18
- data/lib/shopify_api/version.rb +1 -1
- data/test/active_resource/json_errors_test.rb +22 -0
- data/test/article_test.rb +11 -0
- data/test/asset_test.rb +0 -1
- data/test/base_test.rb +0 -7
- data/test/customer_test.rb +10 -0
- data/test/fixtures/customers_search.json +60 -0
- data/test/fixtures/fulfillment_service.json +10 -0
- data/test/fixtures/image.json +10 -0
- data/test/fixtures/images.json +20 -0
- data/test/fixtures/order_risk.json +14 -0
- data/test/fixtures/order_risks.json +28 -0
- data/test/fixtures/recurring_application_charges.json +10 -0
- data/test/fixtures/variant.json +2 -1
- data/test/fixtures/variants.json +8 -4
- data/test/fulfillment_service_test.rb +17 -0
- data/test/image_test.rb +26 -0
- data/test/limits_test.rb +0 -1
- data/test/order_risk_test.rb +46 -0
- data/test/recurring_application_charge_test.rb +21 -0
- data/test/session_test.rb +44 -17
- data/test/test_helper.rb +6 -6
- data/test/variant_test.rb +14 -0
- metadata +49 -18
- checksums.yaml +0 -7
- data/lib/shopify_api/resources/product_search_engine.rb +0 -4
data/test/test_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'test/unit'
|
3
3
|
require 'fakeweb'
|
4
|
-
require 'mocha'
|
4
|
+
require 'mocha/setup'
|
5
5
|
|
6
6
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
7
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
@@ -19,7 +19,7 @@ class Test::Unit::TestCase
|
|
19
19
|
def self.should(string, &block)
|
20
20
|
self.test("should_#{string}", &block)
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def self.context(string)
|
24
24
|
yield
|
25
25
|
end
|
@@ -43,7 +43,7 @@ class Test::Unit::TestCase
|
|
43
43
|
def teardown
|
44
44
|
FakeWeb.clean_registry
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
# Custom Assertions
|
48
48
|
def assert_not(expression)
|
49
49
|
assert_block("Expected <#{expression}> to be false!") { not expression }
|
@@ -58,13 +58,13 @@ class Test::Unit::TestCase
|
|
58
58
|
format = options.delete(:format) || :json
|
59
59
|
method = options.delete(:method) || :get
|
60
60
|
extension = ".#{options.delete(:extension)||'json'}" unless options[:extension]==false
|
61
|
-
|
61
|
+
|
62
62
|
url = if options.has_key?(:url)
|
63
63
|
options[:url]
|
64
|
-
else
|
64
|
+
else
|
65
65
|
"http://localhost/admin/#{endpoint}#{extension}"
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
68
|
FakeWeb.register_uri(method, url, {:body => body, :status => 200, :content_type => "text/#{format}", :content_length => 1}.merge(options))
|
69
69
|
end
|
70
70
|
end
|
data/test/variant_test.rb
CHANGED
@@ -19,4 +19,18 @@ class VariantTest < Test::Unit::TestCase
|
|
19
19
|
|
20
20
|
v = ShopifyAPI::Variant.find(808950810)
|
21
21
|
end
|
22
|
+
|
23
|
+
def test_product_id_should_be_accessible_if_via_product_endpoint
|
24
|
+
fake "products/632910392/variants/808950810", :method => :get, :body => load_fixture('variant')
|
25
|
+
|
26
|
+
v = ShopifyAPI::Variant.find(808950810, :params => {:product_id => 632910392})
|
27
|
+
assert_equal 632910392, v.product_id
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_product_id_should_be_accessible_if_via_variant_endpoint
|
31
|
+
fake "variants/808950810", :method => :get, :body => load_fixture('variant')
|
32
|
+
|
33
|
+
v = ShopifyAPI::Variant.find(808950810)
|
34
|
+
assert_equal 632910392, v.product_id
|
35
|
+
end
|
22
36
|
end
|
metadata
CHANGED
@@ -1,83 +1,94 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Shopify
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2014-01-24 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: activeresource
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- - '>='
|
19
|
+
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: 3.0.0
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 3.0.0
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: thor
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- - '>='
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: 0.14.4
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- - '>='
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: 0.14.4
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: mocha
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- - '>='
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: 0.9.8
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- - '>='
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: 0.9.8
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: fakeweb
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- - '>='
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- - '>='
|
75
|
+
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0'
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: rake
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
|
-
- - '>='
|
83
|
+
- - ! '>='
|
74
84
|
- !ruby/object:Gem::Version
|
75
85
|
version: '0'
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
|
-
- - '>='
|
91
|
+
- - ! '>='
|
81
92
|
- !ruby/object:Gem::Version
|
82
93
|
version: '0'
|
83
94
|
description: The Shopify API gem allows Ruby developers to programmatically access
|
@@ -94,10 +105,14 @@ extra_rdoc_files:
|
|
94
105
|
files:
|
95
106
|
- .document
|
96
107
|
- .gitignore
|
108
|
+
- .travis.yml
|
97
109
|
- CHANGELOG
|
98
110
|
- CONTRIBUTORS
|
99
111
|
- Gemfile
|
100
112
|
- Gemfile.lock
|
113
|
+
- Gemfile_ar30
|
114
|
+
- Gemfile_ar31
|
115
|
+
- Gemfile_ar32
|
101
116
|
- LICENSE
|
102
117
|
- README.rdoc
|
103
118
|
- RELEASING
|
@@ -108,6 +123,7 @@ files:
|
|
108
123
|
- lib/active_resource/detailed_log_subscriber.rb
|
109
124
|
- lib/active_resource/disable_prefix_check.rb
|
110
125
|
- lib/active_resource/json_errors.rb
|
126
|
+
- lib/active_resource/to_query.rb
|
111
127
|
- lib/shopify_api.rb
|
112
128
|
- lib/shopify_api/cli.rb
|
113
129
|
- lib/shopify_api/countable.rb
|
@@ -135,6 +151,7 @@ files:
|
|
135
151
|
- lib/shopify_api/resources/customer_saved_search.rb
|
136
152
|
- lib/shopify_api/resources/event.rb
|
137
153
|
- lib/shopify_api/resources/fulfillment.rb
|
154
|
+
- lib/shopify_api/resources/fulfillment_service.rb
|
138
155
|
- lib/shopify_api/resources/image.rb
|
139
156
|
- lib/shopify_api/resources/line_item.rb
|
140
157
|
- lib/shopify_api/resources/location.rb
|
@@ -142,10 +159,10 @@ files:
|
|
142
159
|
- lib/shopify_api/resources/note_attribute.rb
|
143
160
|
- lib/shopify_api/resources/option.rb
|
144
161
|
- lib/shopify_api/resources/order.rb
|
162
|
+
- lib/shopify_api/resources/order_risk.rb
|
145
163
|
- lib/shopify_api/resources/page.rb
|
146
164
|
- lib/shopify_api/resources/payment_details.rb
|
147
165
|
- lib/shopify_api/resources/product.rb
|
148
|
-
- lib/shopify_api/resources/product_search_engine.rb
|
149
166
|
- lib/shopify_api/resources/province.rb
|
150
167
|
- lib/shopify_api/resources/receipt.rb
|
151
168
|
- lib/shopify_api/resources/recurring_application_charge.rb
|
@@ -164,6 +181,7 @@ files:
|
|
164
181
|
- lib/shopify_api/session.rb
|
165
182
|
- lib/shopify_api/version.rb
|
166
183
|
- shopify_api.gemspec
|
184
|
+
- test/active_resource/json_errors_test.rb
|
167
185
|
- test/article_test.rb
|
168
186
|
- test/asset_test.rb
|
169
187
|
- test/base_test.rb
|
@@ -171,6 +189,7 @@ files:
|
|
171
189
|
- test/cart_test.rb
|
172
190
|
- test/cli_test.rb
|
173
191
|
- test/customer_saved_search_test.rb
|
192
|
+
- test/customer_test.rb
|
174
193
|
- test/detailed_log_subscriber_test.rb
|
175
194
|
- test/fixtures/article.json
|
176
195
|
- test/fixtures/articles.json
|
@@ -182,20 +201,31 @@ files:
|
|
182
201
|
- test/fixtures/carts.json
|
183
202
|
- test/fixtures/customer_saved_search.json
|
184
203
|
- test/fixtures/customer_saved_search_customers.json
|
204
|
+
- test/fixtures/customers_search.json
|
185
205
|
- test/fixtures/events.json
|
186
206
|
- test/fixtures/fulfillment.json
|
207
|
+
- test/fixtures/fulfillment_service.json
|
208
|
+
- test/fixtures/image.json
|
209
|
+
- test/fixtures/images.json
|
187
210
|
- test/fixtures/metafield.json
|
188
211
|
- test/fixtures/metafields.json
|
212
|
+
- test/fixtures/order_risk.json
|
213
|
+
- test/fixtures/order_risks.json
|
189
214
|
- test/fixtures/product.json
|
215
|
+
- test/fixtures/recurring_application_charges.json
|
190
216
|
- test/fixtures/shop.json
|
191
217
|
- test/fixtures/tags.json
|
192
218
|
- test/fixtures/transaction.json
|
193
219
|
- test/fixtures/variant.json
|
194
220
|
- test/fixtures/variants.json
|
221
|
+
- test/fulfillment_service_test.rb
|
195
222
|
- test/fulfillment_test.rb
|
223
|
+
- test/image_test.rb
|
196
224
|
- test/limits_test.rb
|
225
|
+
- test/order_risk_test.rb
|
197
226
|
- test/order_test.rb
|
198
227
|
- test/product_test.rb
|
228
|
+
- test/recurring_application_charge_test.rb
|
199
229
|
- test/session_test.rb
|
200
230
|
- test/shop_test.rb
|
201
231
|
- test/test_helper.rb
|
@@ -204,27 +234,28 @@ files:
|
|
204
234
|
homepage: http://www.shopify.com/partners/apps
|
205
235
|
licenses:
|
206
236
|
- MIT
|
207
|
-
metadata: {}
|
208
237
|
post_install_message:
|
209
238
|
rdoc_options:
|
210
239
|
- --charset=UTF-8
|
211
240
|
require_paths:
|
212
241
|
- lib
|
213
242
|
required_ruby_version: !ruby/object:Gem::Requirement
|
243
|
+
none: false
|
214
244
|
requirements:
|
215
|
-
- - '>='
|
245
|
+
- - ! '>='
|
216
246
|
- !ruby/object:Gem::Version
|
217
247
|
version: '0'
|
218
248
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
249
|
+
none: false
|
219
250
|
requirements:
|
220
|
-
- - '>='
|
251
|
+
- - ! '>='
|
221
252
|
- !ruby/object:Gem::Version
|
222
253
|
version: '0'
|
223
254
|
requirements: []
|
224
255
|
rubyforge_project:
|
225
|
-
rubygems_version:
|
256
|
+
rubygems_version: 1.8.23
|
226
257
|
signing_key:
|
227
|
-
specification_version:
|
258
|
+
specification_version: 3
|
228
259
|
summary: ShopifyAPI is a lightweight gem for accessing the Shopify admin REST web
|
229
260
|
services
|
230
261
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: f107b47a300751663d847a7b27d3e0bc40d6a23f
|
4
|
-
data.tar.gz: 73094dbd7e250b929f96995a0337b83cc468d943
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 2d5a37087e8921df1a51aeaa7d4de064bacd87d2c4c5319aeb6c207a0832dd754e6565c7caa915532744790844e97b5081145fbff9d87e661b87c5155a2681e2
|
7
|
-
data.tar.gz: e8bd2c7c19cc061577b9948b20c4b6e3b8e6cc3abaf9ccec073304210c7a62b46bd0a8ac6b41c2ddaf5295e029a148db11e351f092e1535f6842a2cbb53a2207
|