Sha256: 0a948efff9335caedba820d6357b7cdd4128aadbe6490f72225585c45e5ce82a

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 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 = '1562'
    order.total_amount = "249.00"
    order.delivery_type = "P"
    order.partner_order_number = rand(100000000000)
    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 invalid sku" do
      begin
        service.place_order(order)
      rescue FastshopCatalog::ServiceException => e
        expect(e.code).to eq(12)
        expect(e.description).to eq('SKU invalido')
      end
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.8 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb
fastshop_catalog-0.0.7 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb
fastshop_catalog-0.0.6 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb
fastshop_catalog-0.0.5 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb
fastshop_catalog-0.0.4 spec/fastshop_catalog/integration/order_placement_service_integration_spec.rb