Sha256: f0587235f195d0963569b383a2ad72111edd5d729709209818a3db28c1bebf7f

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

shared_examples 'Unidom::Inventory::Concerns::AsStored' do |model_attributes|

  before :each do
  end

  after :each do
  end

  context do

    grouped_inventory_item_1_attributes = {
      store_id:   SecureRandom.uuid,
      store_type: 'Unidom::Inventory::Stored::Mock',
      lot_id:     SecureRandom.uuid,
      quantity:   10.00
    }

    grouped_inventory_item_2_attributes = {
      store_id:   SecureRandom.uuid,
      store_type: 'Unidom::Inventory::Stored::Mock',
      lot_id:     SecureRandom.uuid,
      quantity:   20.00
    }

    it_behaves_like 'has_many', model_attributes, :grouped_inventory_items, Unidom::Inventory::GroupedInventoryItem, [ grouped_inventory_item_1_attributes, grouped_inventory_item_2_attributes ]

    serialized_inventory_item_1_attributes = {
      store_id:      SecureRandom.uuid,
      store_type:    'Unidom::Inventory::Stored::Mock',
      lot_id:        SecureRandom.uuid,
      serial_number: SecureRandom.hex(16)
    }

    serialized_inventory_item_2_attributes = {
      store_id:      SecureRandom.uuid,
      store_type:    'Unidom::Inventory::Stored::Mock',
      lot_id:        SecureRandom.uuid,
      serial_number: SecureRandom.hex(16)
    }

    it_behaves_like 'has_many', model_attributes, :serialized_inventory_items, Unidom::Inventory::SerializedInventoryItem, [ serialized_inventory_item_1_attributes, serialized_inventory_item_2_attributes ]

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
unidom-inventory-2.0.1 lib/rspec/models/unidom/inventory/concerns/as_stored_shared_examples.rb
unidom-inventory-2.0 lib/rspec/models/unidom/inventory/concerns/as_stored_shared_examples.rb
unidom-inventory-1.0.5 lib/rspec/models/unidom/inventory/concerns/as_stored_shared_examples.rb