fastshop_catalog 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastshop_catalog/check_availability_service.rb +1 -1
- data/lib/fastshop_catalog/version.rb +1 -1
- data/spec/fastshop_catalog/check_availability_service_spec.rb +1 -1
- data/spec/fastshop_catalog/integration/check_availability_service_integration_spec.rb +7 -3
- data/spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb +5 -5
- 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: d580bd8e839ff0ce0f1599a1dc0c6366ae0cf514
|
4
|
+
data.tar.gz: c164cd58c8b1a340a2c2bb1756a23869b21ac094
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12fd73b0ff5263aeed12164d7331892381e0a77f1d0604e36a2f9d8b16df95ea6941e668bcdaa36e1b6ceb8fe2e4af2b20030978d42a5c8785ce2ee37ef17eea
|
7
|
+
data.tar.gz: b584191241e9dd989cead46c737d608a7f9c9e7db406a9fa6ffa39e48c3be69e90ef3456f3340d210dfe7780dbbea9a4691c43e714e8281ff1e25ae09adcb647
|
@@ -13,7 +13,7 @@ module FastshopCatalog
|
|
13
13
|
root_attributes = order.to_map
|
14
14
|
adapted_items = []
|
15
15
|
root_attributes['Itens'].each do |item|
|
16
|
-
adapted_items << {'fas:
|
16
|
+
adapted_items << {'fas:ColocacaoPedidoItensEntity' => adapt_output(item.to_map, 'fas')}
|
17
17
|
end
|
18
18
|
root_attributes['Itens'] = adapted_items
|
19
19
|
service_invoker('dadosPedido' => adapt_output(root_attributes, 'fas'))
|
@@ -23,7 +23,7 @@ describe FastshopCatalog::CheckAvailabilityService do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
let(:order_fixture) do
|
26
|
-
{"tns:dadosPedido"=>{"fas:Cep"=>"02029001", "fas:Contrato"=>"1234567890", "fas:Cpf"=>"73978898160", "fas:Itens"=>[{"fas:
|
26
|
+
{"tns:dadosPedido"=>{"fas:Cep"=>"02029001", "fas:Contrato"=>"1234567890", "fas:Cpf"=>"73978898160", "fas:Itens"=>[{"fas:ColocacaoPedidoItensEntity"=>{"fas:Quantidade"=>1, "fas:Sku"=>"SODPFC70A", "fas:ValorUnitario"=>"249.00"}}], "fas:Numero"=>"1560", "fas:ValorTotal"=>"249.00"}}
|
27
27
|
end
|
28
28
|
|
29
29
|
let(:fixture) do
|
@@ -8,7 +8,7 @@ describe FastshopCatalog::CheckAvailabilityService do
|
|
8
8
|
order.contract_code = '1234567890'
|
9
9
|
order.zip_code = '04562030'
|
10
10
|
order.document = '73978898160'
|
11
|
-
order.number = '
|
11
|
+
order.number = '1561'
|
12
12
|
order.total_amount = "249.00"
|
13
13
|
order.delivery_type = "P"
|
14
14
|
order.partner_order_number = "1234568119"
|
@@ -23,8 +23,12 @@ describe FastshopCatalog::CheckAvailabilityService do
|
|
23
23
|
|
24
24
|
describe "check integration", :integration => true do
|
25
25
|
it "should check that the order is ok" do
|
26
|
-
|
27
|
-
|
26
|
+
begin
|
27
|
+
service = FastshopCatalog::CheckAvailabilityService.new
|
28
|
+
result = service.check(order)
|
29
|
+
rescue FastshopCatalog::ServiceException => e
|
30
|
+
expect(e.code).to eq(11)
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
end
|
@@ -12,10 +12,10 @@ describe FastshopCatalog::OrderPlacementService do
|
|
12
12
|
order.contract_code = '1234567890'
|
13
13
|
order.zip_code = '04562030'
|
14
14
|
order.document = '73978898160'
|
15
|
-
order.number = '
|
15
|
+
order.number = '1562'
|
16
16
|
order.total_amount = "249.00"
|
17
17
|
order.delivery_type = "P"
|
18
|
-
order.partner_order_number =
|
18
|
+
order.partner_order_number = rand(100000000000)
|
19
19
|
order_item = FastshopCatalog::Entity::OrderItem.new
|
20
20
|
order_item.sku = 'SODPFC70A'
|
21
21
|
order_item.quantity = 1
|
@@ -30,12 +30,12 @@ describe FastshopCatalog::OrderPlacementService do
|
|
30
30
|
|
31
31
|
describe "place_order integration", :integration => true do
|
32
32
|
|
33
|
-
it "should raise
|
33
|
+
it "should raise invalid sku" do
|
34
34
|
begin
|
35
35
|
service.place_order(order)
|
36
36
|
rescue FastshopCatalog::ServiceException => e
|
37
|
-
expect(e.code).to eq(
|
38
|
-
expect(e.description).to eq('
|
37
|
+
expect(e.code).to eq(12)
|
38
|
+
expect(e.description).to eq('SKU invalido')
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastshop_catalog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thiago Ganzarolli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|