Sha256: 9f6b471fde23b22befecd881378e2681711ff6afd14e1a88e7a9da118d88f7f2

Contents?: true

Size: 929 Bytes

Versions: 3

Compression:

Stored size: 929 Bytes

Contents

# encoding: utf-8
require "spec_helper"

describe FastshopCatalog::CheckAvailabilityService do

  let(:order) do
    order = FastshopCatalog::Entity::Order.new
    order.contract_code = '1234567890'
    order.zip_code = '04562030'
    order.document = '73978898160'
    order.number = '1561'
    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

  describe "check integration", :integration => true do
    it "should check that the order is ok" do
      begin
        service = FastshopCatalog::CheckAvailabilityService.new
        result = service.check(order)
      rescue FastshopCatalog::ServiceException => e
        expect(e.code).to eq(15)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.8 spec/fastshop_catalog/integration/check_availability_service_integration_spec.rb
fastshop_catalog-0.0.7 spec/fastshop_catalog/integration/check_availability_service_integration_spec.rb
fastshop_catalog-0.0.6 spec/fastshop_catalog/integration/check_availability_service_integration_spec.rb