Sha256: b74ca4f6ac4ebc56267dc784d398d7697f350d250301fcafb488b7f7fac4ec8e

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 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 = '02029001'
    order.document = '73978898160'
    order.number = '1560'
    order.total_amount = "69.00"
    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

  describe "check integration", :integration => true do
    it "should check that the order is not available" do
      service = FastshopCatalog::CheckAvailabilityService.new
      expect{service.check(order)}.to raise_error(FastshopCatalog::ServiceException) do |e|
        expect(e.code).to eq(36)
        expect(e.description).to eq('Pedido indisponível')
      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/check_availability_service_integration_spec.rb
fastshop_catalog-0.0.1 spec/fastshop_catalog/integration/check_availability_service_integration_spec.rb