shopkit 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/shopkit/connection.rb
CHANGED
@@ -12,7 +12,7 @@ module Shopkit
|
|
12
12
|
builder.request :oauth2, access_token
|
13
13
|
builder.request :json # fixed: NoMethodError: undefined method `bytesize' for {...}:Hash
|
14
14
|
|
15
|
-
builder.response :logger
|
15
|
+
#builder.response :logger
|
16
16
|
builder.response :json, :content_type => /\bjson$/
|
17
17
|
|
18
18
|
builder.adapter :net_http
|
data/lib/shopkit/version.rb
CHANGED
data/shopkit.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "shopkit"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["saberma"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-08-01"
|
13
13
|
s.description = "a gem for the ShopQi API"
|
14
14
|
s.email = "mahb45@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
"lib/shopkit/client/orders.rb",
|
31
31
|
"lib/shopkit/client/products.rb",
|
32
32
|
"lib/shopkit/client/shop.rb",
|
33
|
+
"lib/shopkit/client/variants.rb",
|
33
34
|
"lib/shopkit/client/webhooks.rb",
|
34
35
|
"lib/shopkit/configuration.rb",
|
35
36
|
"lib/shopkit/connection.rb",
|
@@ -40,8 +41,10 @@ Gem::Specification.new do |s|
|
|
40
41
|
"spec/json/orders.json",
|
41
42
|
"spec/json/products.json",
|
42
43
|
"spec/json/shop.json",
|
44
|
+
"spec/json/variant.json",
|
43
45
|
"spec/json/webhook.json",
|
44
46
|
"spec/shopkit/client/orders_spec.rb",
|
47
|
+
"spec/shopkit/client/product_variants_spec.rb",
|
45
48
|
"spec/shopkit/client/products_spec.rb",
|
46
49
|
"spec/shopkit/client/shop_spec.rb",
|
47
50
|
"spec/shopkit/client/webhooks_spec.rb",
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"variant":
|
3
|
+
{
|
4
|
+
"id": 1,
|
5
|
+
"product_id": 1,
|
6
|
+
"price": 45,
|
7
|
+
"compare_at_price": 69,
|
8
|
+
"weight": 2.9,
|
9
|
+
"sku": "Tee01",
|
10
|
+
"position": 1,
|
11
|
+
"option1": "默认标题",
|
12
|
+
"option2": null,
|
13
|
+
"option3": null,
|
14
|
+
"requires_shipping": true,
|
15
|
+
"inventory_quantity": 0,
|
16
|
+
"inventory_management": "ShopQi",
|
17
|
+
"inventory_policy": "deny",
|
18
|
+
"created_at": "2012-04-16T23:07:33+08:00",
|
19
|
+
"update_at": "2012-04-16T23:07:33+08:00"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Shopkit::Client::Products do
|
4
|
+
|
5
|
+
let(:id) { 1 }
|
6
|
+
|
7
|
+
let(:body) { { variant: { id: id, price: 45 } } }
|
8
|
+
|
9
|
+
before do
|
10
|
+
fake_web "variants/#{id}", method: :put, request_body: body.to_json, json_file: :variant
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should update variant' do
|
14
|
+
variant = Shopkit.update_variant(id, body)
|
15
|
+
variant['price'].should eql 45
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Shopkit::Client::Webhooks do
|
4
4
|
|
5
|
-
let(:request_body) { { webhook: { event:"order/fulfilled", callback_url: "http://lvh.me/webhook" }}.to_json }
|
5
|
+
let(:request_body) { { webhook: { event: "order/fulfilled", callback_url: "http://lvh.me/webhook" }}.to_json }
|
6
6
|
|
7
7
|
before do
|
8
8
|
fake_web 'webhooks', method: :post, request_body: request_body, json_file: :webhook
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- lib/shopkit/client/orders.rb
|
161
161
|
- lib/shopkit/client/products.rb
|
162
162
|
- lib/shopkit/client/shop.rb
|
163
|
+
- lib/shopkit/client/variants.rb
|
163
164
|
- lib/shopkit/client/webhooks.rb
|
164
165
|
- lib/shopkit/configuration.rb
|
165
166
|
- lib/shopkit/connection.rb
|
@@ -170,8 +171,10 @@ files:
|
|
170
171
|
- spec/json/orders.json
|
171
172
|
- spec/json/products.json
|
172
173
|
- spec/json/shop.json
|
174
|
+
- spec/json/variant.json
|
173
175
|
- spec/json/webhook.json
|
174
176
|
- spec/shopkit/client/orders_spec.rb
|
177
|
+
- spec/shopkit/client/product_variants_spec.rb
|
175
178
|
- spec/shopkit/client/products_spec.rb
|
176
179
|
- spec/shopkit/client/shop_spec.rb
|
177
180
|
- spec/shopkit/client/webhooks_spec.rb
|
@@ -191,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
191
194
|
version: '0'
|
192
195
|
segments:
|
193
196
|
- 0
|
194
|
-
hash:
|
197
|
+
hash: 701946319
|
195
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
199
|
none: false
|
197
200
|
requirements:
|