Sha256: 33413b51ba214058ef64b97a9c24bf266e4a8b3a26786c9e5c6d65c4b2c614ae

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8
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 = '04562030'
    order.document = '73978898160'
    order.number = '5'
    order.total_amount = "249.00"
    order.delivery_type = "P"
    order.partner_order_number = "1234568119"
    order_item = FastshopCatalog::Entity::OrderItem.new
    order_item.sku = 'SODPFC70A'
    order_item.quantity = 1
    order_item.price = "249.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
      begin
        service.place_order(order)
      rescue FastshopCatalog::ServiceException => e
        expect(e.code).to eq(15)
        expect(e.description).to eq('Endereço nao encontrado')
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.3 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb