axiomus_api 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +18 -16
- data/README.md +1 -1
- data/lib/axiomus_api/item/item.rb +1 -0
- data/lib/axiomus_api/version.rb +1 -1
- data/spec/factories.rb +21 -2
- data/spec/integration/lib/axiomus_api/session_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c8453b903926852198173e7275c8cc4a2a8fe3
|
4
|
+
data.tar.gz: 39d6bf09d94909bc40efbb8a03cca121b715ce57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0965c2bc0c3222f55666a57ab0d9e56c902f99233e8e7067f0c7ec90b03b5aa85ed44fddf27e8488414a31f951a80bf073b50882c47fc5b19d55c6ef8d90a8a3
|
7
|
+
data.tar.gz: c0de7eaad558b2c07b8ea424d2cb99f28a427b8adb2232b45d6072a59d212b7ff1f87bd76746b333486b1a432f0acf13ce4cd8c0a59e504af4aca2ed35594937
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
axiomus_api (0.5.
|
4
|
+
axiomus_api (0.5.2)
|
5
5
|
barby (~> 0.5)
|
6
6
|
chunky_png (~> 1.3)
|
7
7
|
nokogiri (~> 1.6)
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (4.1.
|
12
|
+
activesupport (4.1.5)
|
13
13
|
i18n (~> 0.6, >= 0.6.9)
|
14
14
|
json (~> 1.7, >= 1.7.7)
|
15
15
|
minitest (~> 5.1)
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
tzinfo (~> 1.1)
|
18
18
|
barby (0.6.1)
|
19
19
|
chunky_png (1.3.1)
|
20
|
-
coveralls (0.7.
|
20
|
+
coveralls (0.7.1)
|
21
21
|
multi_json (~> 1.3)
|
22
22
|
rest-client
|
23
23
|
simplecov (>= 0.7)
|
@@ -27,33 +27,35 @@ GEM
|
|
27
27
|
docile (1.1.5)
|
28
28
|
factory_girl (4.4.0)
|
29
29
|
activesupport (>= 3.0.0)
|
30
|
-
faker (1.3
|
30
|
+
faker (1.4.3)
|
31
31
|
i18n (~> 0.5)
|
32
|
-
i18n (0.6.
|
32
|
+
i18n (0.6.11)
|
33
33
|
json (1.8.1)
|
34
34
|
mime-types (2.3)
|
35
35
|
mini_portile (0.6.0)
|
36
|
-
minitest (5.
|
36
|
+
minitest (5.4.0)
|
37
37
|
multi_json (1.10.1)
|
38
|
-
|
38
|
+
netrc (0.7.7)
|
39
|
+
nokogiri (1.6.3.1)
|
39
40
|
mini_portile (= 0.6.0)
|
40
|
-
rest-client (1.
|
41
|
-
mime-types (>= 1.16)
|
41
|
+
rest-client (1.7.2)
|
42
|
+
mime-types (>= 1.16, < 3.0)
|
43
|
+
netrc (~> 0.7)
|
42
44
|
rspec (3.0.0)
|
43
45
|
rspec-core (~> 3.0.0)
|
44
46
|
rspec-expectations (~> 3.0.0)
|
45
47
|
rspec-mocks (~> 3.0.0)
|
46
48
|
rspec-collection_matchers (1.0.0)
|
47
49
|
rspec-expectations (>= 2.99.0.beta1)
|
48
|
-
rspec-core (3.0.
|
50
|
+
rspec-core (3.0.4)
|
49
51
|
rspec-support (~> 3.0.0)
|
50
|
-
rspec-expectations (3.0.
|
52
|
+
rspec-expectations (3.0.4)
|
51
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
52
54
|
rspec-support (~> 3.0.0)
|
53
|
-
rspec-mocks (3.0.
|
55
|
+
rspec-mocks (3.0.4)
|
54
56
|
rspec-support (~> 3.0.0)
|
55
|
-
rspec-support (3.0.
|
56
|
-
simplecov (0.
|
57
|
+
rspec-support (3.0.4)
|
58
|
+
simplecov (0.9.0)
|
57
59
|
docile (~> 1.1.0)
|
58
60
|
multi_json
|
59
61
|
simplecov-html (~> 0.8.0)
|
@@ -62,8 +64,8 @@ GEM
|
|
62
64
|
tins (~> 1.0)
|
63
65
|
thor (0.19.1)
|
64
66
|
thread_safe (0.3.4)
|
65
|
-
tins (1.3.
|
66
|
-
tzinfo (1.2.
|
67
|
+
tins (1.3.2)
|
68
|
+
tzinfo (1.2.2)
|
67
69
|
thread_safe (~> 0.1)
|
68
70
|
|
69
71
|
PLATFORMS
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
This is a Ruby wrapper over [Axiomus](http://www.axiomus.ru "axiomus.ru") delivery service public [API](http://www.axiomus.ru/customers/api/ "Axiomus API").
|
12
12
|
|
13
|
-
All methods exposed by the API v.
|
13
|
+
All methods exposed by the API v.2.14 are implemented. Also `expmode` attribute of an `Item` introduced by API v.2.20 is supported.
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
data/lib/axiomus_api/version.rb
CHANGED
data/spec/factories.rb
CHANGED
@@ -36,6 +36,10 @@ FactoryGirl.define do
|
|
36
36
|
weight {rand(0.1..10.0)}
|
37
37
|
quantity {rand(1..10)}
|
38
38
|
price {rand(0.5..10000.0)}
|
39
|
+
|
40
|
+
factory :return_item do
|
41
|
+
expmode 1
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
factory :export_item, class: AxiomusApi::ExportItem, parent: :item do
|
@@ -48,6 +52,12 @@ FactoryGirl.define do
|
|
48
52
|
end
|
49
53
|
end
|
50
54
|
|
55
|
+
factory :return_items, class: AxiomusApi::Items do
|
56
|
+
after(:build) do |items|
|
57
|
+
items.item << build(:return_item)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
51
61
|
factory :export_items, class: AxiomusApi::ExportItems do
|
52
62
|
after(:build) do |items|
|
53
63
|
items.item << build(:export_item)
|
@@ -175,13 +185,22 @@ FactoryGirl.define do
|
|
175
185
|
trait :with_delivset do
|
176
186
|
delivset {build(:delivset)}
|
177
187
|
end
|
188
|
+
|
189
|
+
factory :return_order do
|
190
|
+
items {build(:return_items)}
|
191
|
+
end
|
178
192
|
end
|
179
193
|
|
180
194
|
factory :carry_order, class: AxiomusApi::CarryOrder, parent: :base_order do
|
195
|
+
ignore do
|
196
|
+
b_date_raw {Time.now + rand(5..10)*24*60*60}
|
197
|
+
end
|
198
|
+
|
181
199
|
sms {rand(1..2) ? generate(:sms) : nil}
|
182
200
|
office {[0, 1, nil][rand(0..2)]}
|
183
|
-
|
184
|
-
|
201
|
+
|
202
|
+
b_date {b_date_raw.strftime('%Y-%m-%d')}
|
203
|
+
e_date {(b_date_raw + 7*24*60*60).strftime('%Y-%m-%d')}
|
185
204
|
delivset nil
|
186
205
|
|
187
206
|
trait :with_delivset do
|
@@ -45,6 +45,17 @@ describe AxiomusApi::Session do
|
|
45
45
|
z = @session.status(okey)
|
46
46
|
end
|
47
47
|
|
48
|
+
it 'should create new return order and update it' do
|
49
|
+
order = build(:return_order)
|
50
|
+
z = @session.new(order)
|
51
|
+
expect(z.code).to eq 0
|
52
|
+
okey = z.okey
|
53
|
+
order.okey = okey
|
54
|
+
z = @session.update(order)
|
55
|
+
expect(z.code).to eq 0
|
56
|
+
z = @session.status(okey)
|
57
|
+
end
|
58
|
+
|
48
59
|
it 'should support #delivset field' do
|
49
60
|
order = build(:order, :with_delivset)
|
50
61
|
z = @session.new(order)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: axiomus_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kinderly LTD
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|