Sha256: 10856a425b098b6775f00686402c0a83d0e9efd4daef57e9454b4bd5fa3f96dd

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require "spec_helper"

describe FastshopCatalog::OrderPlacementService do

  let(:contract_number) do
    "1234567890"
  end
  
  let(:order) do
    order = FastshopCatalog::Entity::Order.new
    order.contract_code = '1234567890'
    order.zip_code = '02029001'
    order.document = '73978898160'
    order.number = '1560'
    order.total_amount = "69.00"
    order.delivery_type = "P"
    order.partner_order_number = "1234568119"
    order_item = FastshopCatalog::Entity::OrderItem.new
    order_item.sku = 'IVIEP314RED'
    order_item.quantity = 1
    order_item.price = "69.00"
    order.items = [order_item]
    order
  end

  let(:service) do
    service = FastshopCatalog::OrderPlacementService.new
  end

  describe "place_order integration", :integration => true do

    it "should raise cart not identified" do
      expect{service.place_order(order)}.to raise_error(FastshopCatalog::ServiceException) do |e|
        expect(e.code).to eq(37)
        expect(e.description).to eq('Carrinho nao identificado no sistema')
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.2 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb
fastshop_catalog-0.0.1 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb