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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a6239cc75029327adc4249fbf22da92061da60c
4
- data.tar.gz: 34aa60a7b9755ab6335d76c2073d2d74adcb27f2
3
+ metadata.gz: d580bd8e839ff0ce0f1599a1dc0c6366ae0cf514
4
+ data.tar.gz: c164cd58c8b1a340a2c2bb1756a23869b21ac094
5
5
  SHA512:
6
- metadata.gz: 317dfac02e7b05a875e12ffec410a4d3d9e1352f18b5f41829b6a8073e4932012c7db14f67e56cf78789e05689945bf7baa7b4879078ede049d00b2fedf3c277
7
- data.tar.gz: aa041a18add29279bb13b29b4291a486ca8f048427090919880436bb44a0fa7d09165551435cd9428848b4db7dac0872627e0c851d6c90673b46040063598e6f
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:PedidoItensEntity' => adapt_output(item.to_map, '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'))
@@ -1,3 +1,3 @@
1
1
  module FastshopCatalog
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -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:PedidoItensEntity"=>{"fas:Quantidade"=>1, "fas:Sku"=>"SODPFC70A", "fas:ValorUnitario"=>"249.00"}}], "fas:Numero"=>"1560", "fas:ValorTotal"=>"249.00"}}
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 = '1560'
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
- service = FastshopCatalog::CheckAvailabilityService.new
27
- result = service.check(order)
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 = '5'
15
+ order.number = '1562'
16
16
  order.total_amount = "249.00"
17
17
  order.delivery_type = "P"
18
- order.partner_order_number = "1234568119"
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 cart not identified" do
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(15)
38
- expect(e.description).to eq('Endereço nao encontrado')
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.3
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 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler