Sha256: 34f7849a91beea4bfe888d9a8e4ba4a2befdcb2e4cb1cd78dfb7025b282ec50f

Contents?: true

Size: 738 Bytes

Versions: 2

Compression:

Stored size: 738 Bytes

Contents

describe Unidom::Shipment::ShipmentPackageItem, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      package_id:       SecureRandom.uuid,
      shipment_item_id: SecureRandom.uuid,
      quantity:         10.00
    }

    it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes

    it_behaves_like 'validates numericality', model_attributes, :quantity,
      range: 0..1_000_000_000, minimum_inclusive: false, maximum_inclusive: false

    shipment_package_attributes = {
      serial_number: SecureRandom.hex(16)
    }

    it_behaves_like 'belongs_to', model_attributes, :package, Unidom::Shipment::ShipmentPackage, shipment_package_attributes

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-shipment-1.0 lib/rspec/models/unidom/shipment/shipment_package_item_spec.rb
unidom-shipment-0.7.8 lib/rspec/models/unidom/shipment/shipment_package_item_spec.rb