ship_compliant 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -4
- data/CHANGELOG.md +7 -0
- data/README.md +3 -3
- data/features/step_definitions/brand_steps.rb +3 -3
- data/features/step_definitions/commit_sales_order/all_shipments.rb +1 -1
- data/features/step_definitions/compliance_check/available_product_steps.rb +3 -3
- data/features/step_definitions/compliance_check/missing_product_steps.rb +1 -1
- data/features/step_definitions/compliance_check/noncompliant_product.rb +1 -1
- data/features/step_definitions/product_steps.rb +4 -4
- data/features/step_definitions/sales_order_extended_steps.rb +2 -2
- data/features/step_definitions/search_more_orders_steps.rb +2 -2
- data/features/step_definitions/search_order_steps.rb +2 -2
- data/features/step_definitions/void_order_steps.rb +2 -2
- data/features/support/env.rb +3 -0
- data/lib/ship_compliant/commit_sales_order.rb +1 -1
- data/lib/ship_compliant/version.rb +1 -1
- data/ship_compliant.gemspec +4 -3
- data/spec/lib/ship_compliant/add_update_brand_spec.rb +1 -1
- data/spec/lib/ship_compliant/add_update_product_spec.rb +2 -2
- data/spec/lib/ship_compliant/address/suggested_address_spec.rb +3 -3
- data/spec/lib/ship_compliant/address_spec.rb +16 -16
- data/spec/lib/ship_compliant/base_result_spec.rb +11 -11
- data/spec/lib/ship_compliant/channel_details_spec.rb +4 -4
- data/spec/lib/ship_compliant/check_compliance_result_spec.rb +14 -14
- data/spec/lib/ship_compliant/check_compliance_spec.rb +1 -1
- data/spec/lib/ship_compliant/client_spec.rb +9 -9
- data/spec/lib/ship_compliant/commit_sales_order_result_spec.rb +3 -3
- data/spec/lib/ship_compliant/commit_sales_order_spec.rb +1 -1
- data/spec/lib/ship_compliant/compliance_rule_spec.rb +5 -5
- data/spec/lib/ship_compliant/configuration_spec.rb +8 -8
- data/spec/lib/ship_compliant/error_result_spec.rb +5 -5
- data/spec/lib/ship_compliant/freight_sales_tax_rate_spec.rb +1 -1
- data/spec/lib/ship_compliant/get_inventory_details_result_spec.rb +9 -9
- data/spec/lib/ship_compliant/get_inventory_details_spec.rb +1 -1
- data/spec/lib/ship_compliant/get_sales_order_extended_result_spec.rb +11 -11
- data/spec/lib/ship_compliant/get_sales_order_extended_spec.rb +2 -2
- data/spec/lib/ship_compliant/inventory_product_spec.rb +13 -13
- data/spec/lib/ship_compliant/order_search_spec.rb +3 -3
- data/spec/lib/ship_compliant/package_spec.rb +2 -2
- data/spec/lib/ship_compliant/product_attributes_spec.rb +4 -4
- data/spec/lib/ship_compliant/product_sales_tax_rate_spec.rb +3 -3
- data/spec/lib/ship_compliant/sales_tax_rate_spec.rb +2 -2
- data/spec/lib/ship_compliant/search_sales_order_summary_spec.rb +5 -5
- data/spec/lib/ship_compliant/search_sales_orders_result_spec.rb +12 -12
- data/spec/lib/ship_compliant/search_sales_orders_spec.rb +2 -2
- data/spec/lib/ship_compliant/shipment_compliance_spec.rb +5 -5
- data/spec/lib/ship_compliant/shipment_sales_tax_rate_spec.rb +1 -1
- data/spec/lib/ship_compliant/shipment_spec.rb +13 -13
- data/spec/lib/ship_compliant/void_sales_order_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -3
- metadata +21 -12
@@ -22,7 +22,7 @@ module ShipCompliant
|
|
22
22
|
response[:count_sales_orders_returned] = '5'
|
23
23
|
result = SearchSalesOrdersResult.new(response)
|
24
24
|
|
25
|
-
result.length.
|
25
|
+
expect(result.length).to eq(5)
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -31,50 +31,50 @@ module ShipCompliant
|
|
31
31
|
response[:count_more_sales_orders_available] = '8'
|
32
32
|
result = SearchSalesOrdersResult.new(response)
|
33
33
|
|
34
|
-
result.remaining_orders_length.
|
34
|
+
expect(result.remaining_orders_length).to eq(8)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
context "paging_cookie" do
|
39
39
|
it "gets the paging cookie" do
|
40
40
|
result = SearchSalesOrdersResult.new(response)
|
41
|
-
result.paging_cookie.
|
41
|
+
expect(result.paging_cookie).to eq('paging-cookie')
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
context "paging_cookie_expires" do
|
46
46
|
it "gets the expiration date" do
|
47
47
|
result = SearchSalesOrdersResult.new(response)
|
48
|
-
result.paging_cookie_expires.
|
48
|
+
expect(result.paging_cookie_expires).to eq(Date.new(2014, 1, 1))
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
context "summaries" do
|
53
53
|
it "returns an array of SearchSalesOrderSummary" do
|
54
54
|
result = SearchSalesOrdersResult.new(response)
|
55
|
-
result.summaries[0].
|
55
|
+
expect(result.summaries[0]).to be_kind_of(SearchSalesOrderSummary)
|
56
56
|
end
|
57
57
|
|
58
58
|
it "returns empty array when blank" do
|
59
59
|
result = SearchSalesOrdersResult.new({})
|
60
|
-
result.summaries.
|
60
|
+
expect(result.summaries).to eq([])
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
64
|
context "parse!" do
|
65
65
|
it "adds missing sales_orders summaries" do
|
66
66
|
result = SearchSalesOrdersResult.new({})
|
67
|
-
result.raw.
|
67
|
+
expect(result.raw).to eq({
|
68
68
|
sales_orders: {
|
69
69
|
sales_order_summary: [{}]
|
70
70
|
}
|
71
|
-
}
|
71
|
+
})
|
72
72
|
end
|
73
73
|
|
74
74
|
it "converts single order summary to an array" do
|
75
75
|
result = SearchSalesOrdersResult.new(response)
|
76
76
|
|
77
|
-
result.raw.
|
77
|
+
expect(result.raw).to eq({
|
78
78
|
paging_cookie: 'paging-cookie',
|
79
79
|
paging_cookie_expires: Date.new(2014, 1, 1),
|
80
80
|
sales_orders: {
|
@@ -82,7 +82,7 @@ module ShipCompliant
|
|
82
82
|
shipments: {}
|
83
83
|
]
|
84
84
|
}
|
85
|
-
}
|
85
|
+
})
|
86
86
|
end
|
87
87
|
|
88
88
|
it "converts fields to integers" do
|
@@ -99,7 +99,7 @@ module ShipCompliant
|
|
99
99
|
|
100
100
|
result = SearchSalesOrdersResult.new(response)
|
101
101
|
|
102
|
-
result.raw.
|
102
|
+
expect(result.raw).to eq({
|
103
103
|
paging_cookie: 'paging-cookie',
|
104
104
|
paging_cookie_expires: Date.new(2014, 1, 1),
|
105
105
|
count_more_sales_orders_available: 10,
|
@@ -114,7 +114,7 @@ module ShipCompliant
|
|
114
114
|
}
|
115
115
|
]
|
116
116
|
}
|
117
|
-
}
|
117
|
+
})
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -32,10 +32,10 @@ module ShipCompliant
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it "returns a SearchSalesOrdersResult" do
|
35
|
-
SearchSalesOrders.
|
35
|
+
allow(SearchSalesOrders).to receive(:search_sales) { {} }
|
36
36
|
|
37
37
|
result = SearchSalesOrders.find_by({})
|
38
|
-
result.
|
38
|
+
expect(result).to be_kind_of(SearchSalesOrdersResult)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -5,21 +5,21 @@ module ShipCompliant
|
|
5
5
|
|
6
6
|
context "compliant?" do
|
7
7
|
it "check is a shipment was compliant" do
|
8
|
-
subject.compliant
|
8
|
+
expect(subject.compliant?).to be_truthy
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
context "shipment_key" do
|
13
13
|
it "returns the shipment key" do
|
14
|
-
subject.shipment_key.
|
14
|
+
expect(subject.shipment_key).to eq('AN-ORDER-KEY')
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
context "rules" do
|
19
19
|
it "returns an array of ComplianceRule" do
|
20
|
-
subject.rules.
|
20
|
+
expect(subject.rules).to eq([
|
21
21
|
ComplianceRule.new(compliance_description: "You're clear for take off ghost rider")
|
22
|
-
]
|
22
|
+
])
|
23
23
|
end
|
24
24
|
|
25
25
|
it "returns an empty array when none found" do
|
@@ -27,7 +27,7 @@ module ShipCompliant
|
|
27
27
|
rules: nil
|
28
28
|
})
|
29
29
|
|
30
|
-
shipment.rules.
|
30
|
+
expect(shipment.rules).to eq([])
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -5,79 +5,79 @@ module ShipCompliant
|
|
5
5
|
|
6
6
|
context "fulfillment_house" do
|
7
7
|
it "gets the fulfillment_house" do
|
8
|
-
subject.fulfillment_house.
|
8
|
+
expect(subject.fulfillment_house).to eq('Chucky Cheese')
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
context "fulfillment_exception_reason" do
|
13
13
|
it "gets the fulfillment_exception_reason" do
|
14
|
-
subject.fulfillment_exception_reason.
|
14
|
+
expect(subject.fulfillment_exception_reason).to eq('Cheese must be aged.')
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
context "fulfillment_exception_type" do
|
19
19
|
it "gets the fulfillment_exception_type" do
|
20
|
-
subject.fulfillment_exception_type.
|
20
|
+
expect(subject.fulfillment_exception_type).to eq('None')
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
context "fulfillment_status" do
|
25
25
|
it "gets the fulfillment_status" do
|
26
|
-
subject.fulfillment_status.
|
26
|
+
expect(subject.fulfillment_status).to eq('Accepted')
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
context "handling" do
|
31
31
|
it "gets the handling" do
|
32
|
-
subject.handling.
|
32
|
+
expect(subject.handling).to eq(338.33)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
context "insured_amount" do
|
37
37
|
it "gets the insured_amount" do
|
38
|
-
subject.insured_amount.
|
38
|
+
expect(subject.insured_amount).to eq(10000.33)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
context "shipping" do
|
43
43
|
it "gets the shipping" do
|
44
|
-
subject.shipping.
|
44
|
+
expect(subject.shipping).to eq(23.44)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
48
|
context "ship_date" do
|
49
49
|
it "gets the ship_date" do
|
50
|
-
subject.ship_date.
|
50
|
+
expect(subject.ship_date).to eq(Date.new(2014, 1, 1))
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
context "shipment_status" do
|
55
55
|
it "gets the shipment_status" do
|
56
|
-
subject.shipment_status.
|
56
|
+
expect(subject.shipment_status).to eq('Delivered')
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
context "shipping_service" do
|
61
61
|
it "gets the shipping_service" do
|
62
|
-
subject.shipping_service.
|
62
|
+
expect(subject.shipping_service).to eq('Snortn Boar Transport')
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
66
|
context "special_instructions" do
|
67
67
|
it "gets the special_instructions" do
|
68
|
-
subject.special_instructions.
|
68
|
+
expect(subject.special_instructions).to eq('Get autograph')
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
72
|
context "packages" do
|
73
73
|
it "gets the packages" do
|
74
|
-
subject.packages.
|
74
|
+
expect(subject.packages).to eq([Package.new(tracking: 'info here')])
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
78
|
context "ship_to" do
|
79
79
|
it "gets the shipping address" do
|
80
|
-
subject.ship_to.
|
80
|
+
expect(subject.ship_to).to eq(Address.new(country: 'US'))
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -30,10 +30,10 @@ module ShipCompliant
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "returns a VoidSalesOrderResult" do
|
33
|
-
VoidSalesOrder.
|
33
|
+
allow(VoidSalesOrder).to receive(:void_order) { {} }
|
34
34
|
|
35
35
|
result = VoidSalesOrder.by_order_key('SomeOrderId')
|
36
|
-
result.
|
36
|
+
expect(result).to be_kind_of(VoidSalesOrderResult)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
data/spec/spec_helper.rb
CHANGED
@@ -37,15 +37,15 @@ shared_examples_for "BaseResult" do
|
|
37
37
|
context "success?" do
|
38
38
|
it "returns true when the response was successful" do
|
39
39
|
result = described_class.new({ response_status: 'Success' })
|
40
|
-
result.success
|
40
|
+
expect(result.success?).to be_truthy
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
44
|
context "failure?" do
|
45
45
|
it "returns the opposite of success?" do
|
46
46
|
result = described_class.new({})
|
47
|
-
result.
|
48
|
-
result.failure
|
47
|
+
allow(result).to receive(:success?) { false }
|
48
|
+
expect(result.failure?).to be_truthy
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
metadata
CHANGED
@@ -1,22 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ship_compliant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Baylor Rae'
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '4.0'
|
20
17
|
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 4.0.3
|
@@ -24,9 +21,6 @@ dependencies:
|
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '4.0'
|
30
24
|
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
26
|
version: 4.0.3
|
@@ -106,14 +100,14 @@ dependencies:
|
|
106
100
|
requirements:
|
107
101
|
- - "~>"
|
108
102
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
103
|
+
version: '3.3'
|
110
104
|
type: :development
|
111
105
|
prerelease: false
|
112
106
|
version_requirements: !ruby/object:Gem::Requirement
|
113
107
|
requirements:
|
114
108
|
- - "~>"
|
115
109
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
110
|
+
version: '3.3'
|
117
111
|
- !ruby/object:Gem::Dependency
|
118
112
|
name: cucumber
|
119
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,6 +150,20 @@ dependencies:
|
|
156
150
|
- - "~>"
|
157
151
|
- !ruby/object:Gem::Version
|
158
152
|
version: '2.9'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: dotenv
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '2.0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '2.0'
|
159
167
|
description: The ShipCompliant gem is an API Client for the SOAP API provided by ShipCompliant.
|
160
168
|
This gem has been created for fast implementation and supports the 9 main API calls.
|
161
169
|
email:
|
@@ -166,6 +174,7 @@ extra_rdoc_files: []
|
|
166
174
|
files:
|
167
175
|
- ".gitignore"
|
168
176
|
- ".travis.yml"
|
177
|
+
- CHANGELOG.md
|
169
178
|
- Gemfile
|
170
179
|
- LICENSE.txt
|
171
180
|
- README.md
|
@@ -309,7 +318,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
309
318
|
requirements:
|
310
319
|
- - ">="
|
311
320
|
- !ruby/object:Gem::Version
|
312
|
-
version:
|
321
|
+
version: 2.2.2
|
313
322
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
323
|
requirements:
|
315
324
|
- - ">="
|
@@ -317,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
326
|
version: '0'
|
318
327
|
requirements: []
|
319
328
|
rubyforge_project:
|
320
|
-
rubygems_version: 2.2
|
329
|
+
rubygems_version: 2.5.2
|
321
330
|
signing_key:
|
322
331
|
specification_version: 4
|
323
332
|
summary: SOAP Api Client for ShipCompliant
|