secondrotation-channel_advisor 0.0.4 → 0.0.5
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.
@@ -35,6 +35,9 @@ module ChannelAdvisor
|
|
35
35
|
|
36
36
|
define_method(method_name) do |*args|
|
37
37
|
args = args.unshift(configatron.channel_advisor.account_id)
|
38
|
+
|
39
|
+
verify_mode = configatron.channel_advisor.ssl_config.retrieve('verify_mode', OpenSSL::SSL::VERIFY_PEER)
|
40
|
+
self.client.streamhandler.client.ssl_config.verify_mode = verify_mode
|
38
41
|
|
39
42
|
request_class = service_module.const_get(class_name)
|
40
43
|
request = request_class.new(*args)
|
@@ -28,10 +28,10 @@ describe ChannelAdvisor::MessageCode do
|
|
28
28
|
message_code.code.should == 0
|
29
29
|
end
|
30
30
|
|
31
|
-
it "
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
it "returns an unknown code if the code is not defined" do
|
32
|
+
message_code = ChannelAdvisor::MessageCode.get('12')
|
33
|
+
message_code.code.should == 12
|
34
|
+
message_code.message.should == 'Unknown Error'
|
35
35
|
end
|
36
36
|
|
37
37
|
it "uses the class values for get" do
|
@@ -8,9 +8,43 @@ describe ChannelAdvisor::ServiceProxy do
|
|
8
8
|
configatron.channel_advisor.account_id = 'test_account_id'
|
9
9
|
@client = mock(ChannelAdvisor::InventoryServiceSOAP::InventoryServiceSoap)
|
10
10
|
@client.should_receive(:headerhandler).and_return([])
|
11
|
+
|
12
|
+
@ssl_config = mock(Object)
|
13
|
+
@ssl_config.stub!(:verify_mode=)
|
14
|
+
@streamhandler_client = mock(Object)
|
15
|
+
@streamhandler_client.stub!(:ssl_config).and_return(@ssl_config)
|
16
|
+
@streamhandler = mock(Object)
|
17
|
+
@streamhandler.stub!(:client).and_return(@streamhandler_client)
|
18
|
+
@client.stub!(:streamhandler).and_return(@streamhandler)
|
19
|
+
|
11
20
|
ChannelAdvisor::InventoryServiceSOAP::InventoryServiceSoap.should_receive(:new).and_return(@client)
|
12
21
|
end
|
13
22
|
|
23
|
+
describe 'SSL config' do
|
24
|
+
before(:each) do
|
25
|
+
mock_result = mock(Object, :status => 'Success', :resultData => {})
|
26
|
+
response = mock(ChannelAdvisor::InventoryServiceSOAP::GetFilteredSkuListResponse,
|
27
|
+
:getFilteredSkuListResult => mock_result
|
28
|
+
)
|
29
|
+
@client.should_receive(:getFilteredSkuList).and_return(response)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "sets the default SSL verify mode to VERIFY_PEER" do
|
33
|
+
@ssl_config.should_receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_PEER)
|
34
|
+
inventory = ChannelAdvisor::InventoryService.new
|
35
|
+
inventory.getFilteredSkuList
|
36
|
+
end
|
37
|
+
|
38
|
+
it "sets the SSL verify mode from a configatron parameter" do
|
39
|
+
configatron.temp do
|
40
|
+
configatron.channel_advisor.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
41
|
+
@ssl_config.should_receive(:verify_mode=).with(OpenSSL::SSL::VERIFY_NONE)
|
42
|
+
inventory = ChannelAdvisor::InventoryService.new
|
43
|
+
inventory.getFilteredSkuList
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
14
48
|
it "handles getFilteredSkuList request" do
|
15
49
|
criteria = ChannelAdvisor::InventoryServiceSOAP::InventoryItemCriteria.new
|
16
50
|
criteria.skuStartsWith = 'SR123'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: secondrotation-channel_advisor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Second Rotation, Inc.
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|