blastramp 0.0.8 → 0.0.9
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.
- data/Gemfile.lock +1 -1
- data/lib/blastramp/error.rb +2 -0
- data/lib/blastramp/inventory_count_query.rb +5 -1
- data/lib/blastramp/order_upload.rb +5 -1
- data/lib/blastramp/version.rb +1 -1
- data/spec/blastramp/inventory_count_query_spec.rb +11 -0
- data/spec/blastramp/order_upload_spec.rb +10 -0
- data/spec/fixtures/inventory_count_query/failed_to_authenticate.xml +12 -0
- data/spec/fixtures/order_upload/failed_to_authenticate.xml +12 -0
- metadata +7 -3
data/Gemfile.lock
CHANGED
data/lib/blastramp/error.rb
CHANGED
@@ -21,7 +21,11 @@ module Blastramp
|
|
21
21
|
'Batch' => {:order => order.soap_data}
|
22
22
|
}
|
23
23
|
end
|
24
|
-
response.to_hash[:result]
|
24
|
+
if (response.to_hash[:result] == 'SUCCESS')
|
25
|
+
response.to_hash[:result]
|
26
|
+
elsif (response.to_hash[:error] == 'Failed to Authenticate.')
|
27
|
+
raise(AuthenticationFailure.new)
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
data/lib/blastramp/version.rb
CHANGED
@@ -63,6 +63,17 @@ describe Blastramp::InventoryCountQuery do
|
|
63
63
|
expect{subject.find_by_whid('AAA-01-XX','0001')}.to raise_error(Blastramp::SKUDoesNotExistError)
|
64
64
|
end
|
65
65
|
end
|
66
|
+
|
67
|
+
context "when Failed to Authenticate" do
|
68
|
+
before :each do
|
69
|
+
savon.stubs('InventoryCountQuery').returns(:failed_to_authenticate)
|
70
|
+
end
|
71
|
+
|
72
|
+
it "returns an AuthenticationFailure" do
|
73
|
+
expect{subject.find('XXXX-99-XX')}.to raise_error(Blastramp::AuthenticationFailure)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
66
77
|
|
67
78
|
end
|
68
79
|
|
@@ -20,6 +20,16 @@ describe Blastramp::OrderUpload do
|
|
20
20
|
'Batch' => {:order => order.soap_data}).returns(:success)
|
21
21
|
subject.submit
|
22
22
|
end
|
23
|
+
|
24
|
+
context "when Failed to Authenticate" do
|
25
|
+
before :each do
|
26
|
+
savon.stubs('OrderUpload').returns(:failed_to_authenticate)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "returns an AuthenticationFailure" do
|
30
|
+
expect{subject.submit}.to raise_error(Blastramp::AuthenticationFailure)
|
31
|
+
end
|
32
|
+
end
|
23
33
|
end
|
24
34
|
|
25
35
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<soap:Body>
|
4
|
+
<OrderUploadResponse xmlns="http://chrome52/webservices/">
|
5
|
+
<OrderUploadResult>
|
6
|
+
<result>FAILURE</result>
|
7
|
+
<error>Failed to Authenticate.</error>
|
8
|
+
<orderids/>
|
9
|
+
</OrderUploadResult>
|
10
|
+
</OrderUploadResponse>
|
11
|
+
</soap:Body>
|
12
|
+
</soap:Envelope>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<soap:Body>
|
4
|
+
<OrderUploadResponse xmlns="http://chrome52/webservices/">
|
5
|
+
<OrderUploadResult>
|
6
|
+
<result>FAILURE</result>
|
7
|
+
<error>Failed to Authenticate.</error>
|
8
|
+
<orderids/>
|
9
|
+
</OrderUploadResult>
|
10
|
+
</OrderUploadResponse>
|
11
|
+
</soap:Body>
|
12
|
+
</soap:Envelope>
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 9
|
9
|
+
version: 0.0.9
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- cnantais
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-07-
|
17
|
+
date: 2011-07-12 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -130,8 +130,10 @@ files:
|
|
130
130
|
- spec/blastramp/order_spec.rb
|
131
131
|
- spec/blastramp/order_upload_spec.rb
|
132
132
|
- spec/blastramp/session_spec.rb
|
133
|
+
- spec/fixtures/inventory_count_query/failed_to_authenticate.xml
|
133
134
|
- spec/fixtures/inventory_count_query/many.xml
|
134
135
|
- spec/fixtures/inventory_count_query/sku_does_not_exist.xml
|
136
|
+
- spec/fixtures/order_upload/failed_to_authenticate.xml
|
135
137
|
- spec/fixtures/order_upload/success.xml
|
136
138
|
- spec/fixtures/wsdl.xml
|
137
139
|
- spec/spec_helper.rb
|
@@ -175,8 +177,10 @@ test_files:
|
|
175
177
|
- spec/blastramp/order_spec.rb
|
176
178
|
- spec/blastramp/order_upload_spec.rb
|
177
179
|
- spec/blastramp/session_spec.rb
|
180
|
+
- spec/fixtures/inventory_count_query/failed_to_authenticate.xml
|
178
181
|
- spec/fixtures/inventory_count_query/many.xml
|
179
182
|
- spec/fixtures/inventory_count_query/sku_does_not_exist.xml
|
183
|
+
- spec/fixtures/order_upload/failed_to_authenticate.xml
|
180
184
|
- spec/fixtures/order_upload/success.xml
|
181
185
|
- spec/fixtures/wsdl.xml
|
182
186
|
- spec/spec_helper.rb
|